Question 1: Provide the create table syntax to Create a Table Employee whose details are as below.
Employee(EmployeeID, LastName, FirstName, Address, DateHired)
Answer:
CREATE TABLE Employee (EmployeeID int(10) , LastName varchar(45),
FirstName varchar(45), Address varchar(45), DateHired datetime,
PRIMARY KEY (EmployeeID) );
Question 2: Provide the INSERT query to be used in Employee Table to fill the Details.
Answer:
insert into Employee values(1,'dwivedi','anand','lucknow','2011-12-20');
Question 3: When we give SELECT * FROM EMPLOYEE .How does it Respond?
Answer: it gives all the records of employee table.
Question 4: Create a Table CLIENT whose details are as below.
Client(ClientID, LastName, FirstName, Balance, EmployeeID)
Answer:
CREATE TABLE CLIENT(ClientID integer(10),
LastName varchar(45), Balance float(45), EmployeeID integer(10),
PRIMARY KEY (ClientID));
Question 5: Provide the INSERT query to be used in CLIENT Table to fill the Details.
Answer: insert into CLIENT values(1,'abc',100.04,25);
Question 6: When we give SELECT * FROM CLIENT .How does it Respond?
Answer: It returns all records from CLIENT table.
Question 7: Choose the correct answer. The SQL command to create a table is:
a. Make Table
b. Alter Table
c. Define Table
d. Create Table
Answer: d
Question 8: Choose the correct answer. The DROP TABLE statement:
a. deletes the table structure only
b. deletes the table structure along with the table data
c. works whether or not referential integrity constraints would be violated
d. is not an SQL statement
Answer: b
Question 9: What are the different data types available in SQL server?
Answer: Data types in SQL Server are organized into the following categories:
1. Exact numerics
2. Approximate numerics
3. Date and time
4. Character strings
5. Unicode character strings
6. Binary strings
7. Others
Question 10: Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?
Answer:
DDL: Data Definition Language is the subset which is used to manipulate Oracle database structures. i.e. Create, Alter, Drop
DML statements manipulate only data within the data structures already created by DDL statements.
Question 11: What operator performs pattern matching?
Answer: "like" is the operator used in pattern matching.
Question 12: What operator tests column for the absence of data?
Answer: "is null" operator
Example: select employeeID from Employee where Address is null
Question 13: Which command executes the contents of a specified file?
Answer: START or @.
Question 14: What is the parameter substitution symbol used with INSERT INTO command?
Answer: & is substitution symbol used with insert into command.
Question 15: Which command displays the SQL command in the SQL buffer, and then executes it?
Answer: Run
Question 16: What are the wildcards used for pattern matching?
Answer:
_ for single character substitution
% for multi-character substitution
[charlist] wildcard
Question 17: State whether true or false.
EXISTS, SOME, ANY are operators in SQL.
Answer: True
Question 18: State whether true or false.
!=, <>, ^= all denote the same operation.
Answer: True
Question 19: What are the privileges that can be granted on a table by a user to others?
Answer: Insert, update, delete, select, references, index, execute, alter, all
Question 20: What command is used to get back the privileges offered by the GRANT command?
Answer:
"revoke" is the command which revokes access privileges for database objects previously granted to other users.
Question 21: Which system tables contain information on privileges granted and privileges obtained?
Answer: user_tab_privs_made , user_tab_privs_recd
Question 22: Which system table contains information on constraints on all the tables created?
Answer:
USER_CONSTRAINTS (show all constraints created by the user who has logged in)
ALL_CONSTRAINTS (accessible for dba user only)
Question 23: What is the difference between TRUNCATE and DELETE commands?
Answer:
1. TRUNCATE is a DDL command whereas DELETE is a DML command.
2. TRUNCATE is much faster than DELETE.
3.You cannot rollback in TRUNCATE but in DELETE you can rollback.
TRUNCATE removes the record permanently.
4.In case of TRUNCATE ,Trigger doesn't get fired.But in DML commands like DELETE ,Trigger get fired.
5.You cannot use conditions(WHERE clause) in TRUNCATE.But in DELETE you can write conditions using WHERE clause
Question 24: What command is used to create a table by copying the structure of another table?
Answer: Select * into newtablename from oldtablename
Search This Blog
Popular Posts
-
1.What is the correct syntax of the declaration which defines the XML version? Option: a. b. c. d. None of the above e. Ans: a 2.What is ...
-
1. Which of following represent logical storage of data? Option : a. Table b. View c. None. d. Index Ans: b 2. Which SQL statement is used t...
-
1. Create a washing machine class with methods as switchOn, acceptClothes, acceptDetergent, switchOff. acceptClothes accepts the noofClothes...
-
1.Which of the following is closer to machine Code ? Choose one answer. a. Machine language b. High level language c. None of the above d. A...
-
1.Which of the following Construct in formal model in software engineering execute each statement in succession. Choose one answer. a. Itera...
-
class Problem1 /* creating a class problem1 */ { /* opening braces for class problem1 */ int[] a...
-
1.Which Geography gives the maximum revenue for TCS? Choose one answer. a. Africa b. India c. Asia Pacific d. North America Ans : d 2.Which ...
-
Question 1: Provide the create table syntax to Create a Table Employee whose details are as below. Employee(EmployeeID, LastName, FirstName,...
-
//Improve the understandability of the below given code: import java.util.*; /* it is importing all class in java.util pac...
-
Aspire – Java Assignment-1 - Solutions 1. Write a program to find the difference between sum of the squares and the square of the sums of n ...
Appreciation for nice Updates.Thanks for all your valuable information on this topic.Database Solutions
ReplyDelete