0% found this document useful (0 votes)
46 views3 pages

DBMS

The document contains questions and answers related to SQL commands. It asks about creating tables, inserting data, selecting data, granting and revoking privileges, and differences between truncate and delete commands. It also asks about data types, pattern matching operators, system tables, and copying table structures.

Uploaded by

Deepak Kr Singh
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views3 pages

DBMS

The document contains questions and answers related to SQL commands. It asks about creating tables, inserting data, selecting data, granting and revoking privileges, and differences between truncate and delete commands. It also asks about data types, pattern matching operators, system tables, and copying table structures.

Uploaded by

Deepak Kr Singh
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Instructions Please answer the given questions.

Question 1: Provide the create table syntax to Create a Table Employee whose details are as below. Employee(EmployeeI ! "ast#ame! $irst#ame! %ddress! ate&ired' Ans: create Employee(EmployeeI int(('! "ast#ame varchar()*'!$irtst#ame varchar()*'! %ddress varchar(+*'! ate&ired date', Question 2: Provide the I#-E.T query to be used in Employee Table to /ill the etails. Ans: a' insert into Employee values (0!12u3her4ee1!1Preetha1!15angalore1!1067*67)*0)1', b' insert into Employee values ()!1-hu3la1!1-hivangi1!1Chennai1!1)67*67)*0)1', Question 3: 8hen we give -E"ECT 9 $.:2 E2P":;EE .&ow does it .espond< %ns: 8hen we type the following query of select * from employee it returns all the data present that is all the columns in employee table. In this case it shows the above values in the insert statement. Question 4: Create a Table C"IE#T whose details are as below. Client(ClientI ! "ast#ame! $irst#ame! 5alance! EmployeeI ' Ans: create Client(ClientI int(('! "ast#ame varchar()*'!$irtst#ame varchar()*'! 5alance /loat(0*'! EmployeeI int((', EmployeeID foreign key references Employee(EmployeeID ', Question 5: Provide the I#-E.T query to be used in C"IE#T Table to /ill the etails. Ans: insert into Client values (!lientID,"ast#ame,$irst#ame,%ddress, EmployeeId &alues
(', ,(Dugar(,()e*eswa(,'+,,.,,,+ -

Question 6: 8hen we give -E"ECT 9 $.:2 C"IE#T .&ow does it .espond< Ans: isplays all the attribues with its value Question 7: Choose the correct answer. The -=" command to create a table is: a. 2a3e Table b. %lter Table c. e/ine Table d. Create Table %ns: d. Question 8: Choose the correct answer. The .:P T%5"E statement: a. deletes the table structure only b. deletes the table structure along with the table data c. wor3s whether or not re/erential integrity constraints would be violated d. is not an -=" statement %ns: b. Question 9: 8hat are the di//erent data types available in -=" server< %ns: The di//erent data types are integer!number(p!d'!character(n'!varchar(n'! date! time! timestamp! smallint! /loat(n'!5inary. Question 10: 8hich is the subset o/ -=" commands used to manipulate :racle atabase structures! including tables< %ns: . DD"( Data Deifinition "anguage .

Question 11: 8hat operator per/orms pattern matching< %ns: "I>E operator Question 12: 8hat operator tests column /or the absence o/ data< %ns: I- #?"" operator

Question 13: 8hich command executes the contents o/ a speci/ied /ile< %ns: /)%0) or 1 command. Question 14: 8hat is the parameter substitution symbol used with I#-E.T I#T: command< %ns: 232 commonly known as ampersand operator. Question 15: 8hich command displays the -=" command in the -=" bu//er! and then executes it< %ns: .?# Question 16: 8hat are the wildcards used /or pattern matching< %ns: @ and A Question 17: -tate whether true or /alse. EBI-T-! -:2E! %#; are operators in -=". %ns: T.?E Question 18: -tate whether true or /alse. CD! EF! GD all denote the same operation. %ns: T.?E Question 19: 8hat are the privileges that can be granted on a table by a user to others< %ns: Insert, update, delete, select, references, inde4, e4ecute, alter, all Question 20: 8hat command is used to get bac3 the privileges o//ered by the H.%#T command< %ns: .EI:>E Question 21: 8hich system tables contain in/ormation on privileges granted and privileges obtained< %ns: 5/E06)%7680I&/69%DE, 5/E06)%7680I&/60E!D

Question 22: 8hich system table contains in/ormation on constraints on all the tables created< %ns: 5/E06!:#/)0%I#)/ Question 23: 8hat is the di//erence between T.?#C%TE and E"ETE commands< %ns: '.Delete is a D9" command and )runcate is a DD" command.
+.;here clause can be used with delete only. <.)=E Delete operation can be rolled back, )runcate operation cant be rolled back again that is it is a permanent delete.

Question 24: 8hat command is used to create a table by copying the structure o/ another table<

%ns: .

!0E%)E )%7"E .. %/ /E"E!) command E4planation . )o copy only the structure, the ;=E0E clause of the /E"E!) command should contain a$%"/E statement as in the following. !0E%)E )%7"E #E;)%7"E %/ /E"E!) * $0:9 E>I/)I#?)%7"E ;=E0E '@+If the ;=E0E condition is true, then all the rows or rows satisfying the condition will be copied to the new table.

You might also like