DBMS AND SQL ASSIGNMENT-1

Question 1: Provide the create table syntax to Create a Table Employee whose details areas below. Employee(EmployeeID, LastName, FirstName, Address, DateHired) Answer : CREATE TABLE Employee(EmployeeID int,LastName char(50),FirstName char(50),Address char(50),DateHired date)

Question 2: Provide the INSERT query to be used in Employee Table to fill the Details. Answer : INSERT INTO Employee( EmployeeID,LastName,FirstName,Address,DateHired)Values (value1,value2,value3,value4,value5)

Question 3: When we give SELECT * FROM EMPLOYEE .How does it Respond? Answer : We use SELECT* from EMPLOYEE when we want to select all the columns from the³employee´ tableSample O/P:SELECT * FROM EmployeeEmployeeID LastName FirstName Address DateHiredValue 1 Value2 Value3 Value4 Value5

Question 4: Create a Table CLIENT whose details are as below.Client(ClientID, LastName, FirstName, Balance, EmployeeID) Answer : CREATE TABLE Client(ClientID int,LastName char(50),FirstName char(50),Address char(50),EmployeeId date)

Question 5: Provide the INSERT query to be used in CLIENT Table to fill the Details. Answer : INSERT INTO Client(ClientID,LastName,FirstName,Address, EmployeeId)Values (value1,value2,value3,value4,value5)

Alter Tablec.Data and Time: It stores date and time information. create table Question 8: Choose the correct answer.Monetary: It stores numeric values with decimal places. Binary: It stores data in strict binary (0 or 1) Representation. Define Tabled. Make Tableb. It is used specially for currency values. deletes the table structure onlyb. is not an SQL statement Answer : b.deletes the table structure along with the table data Question 9: What are the different data types available in SQL server? Answer : Numeric: Stores numeric values.Question 6: When we give SELECT * FROM CLIENT .Globally unique identifiers etc.How does it Respond? Answer : We use SELECT* from Client when we want to select all the colums from the³Client´ tableSample O/P:SELECT * FROM ClientClientID LastName FirstName Address EmployeeIDValue 1 Value2 Value3 Value4 Value5 Question 7: Choose the correct answer. works whether or not referential integrity constraints would be violatedd. The DROP TABLE statement:a. Create Table Answer : D.Special purpose: SQL Server contains Complex data types to handle the XML Documents.Character: It supports character based values of varying lengths. deletes the table structure along with the table datac. The SQL command to create a table is:a. including tables? Answer : Data Definition Language (DDL) . Question 10: Which is the subset of SQL commands used to manipulate Oracle Databasestructures.

Question 11: What operator performs pattern matching? Answer : LIKE operator Question 12: What operator tests column for the absence of data? Answer : IS NULL operator 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 INTOcommand? Answer : & Question 15: Which command displays the SQL command in the SQL buffer. SOME. EXISTS. ANY are operators in SQL. Answer : True . and thenexecutes it? Answer : RUN Question 16: What are the wildcards used for pattern matching? Answer : _ for single character substitution and % for multi-character substitution Question 17: State whether true or false.

alter. all Question 20: What command is used to get back the privileges offered by the GRANTcommand? Answer : REVOKE Question 21: Which system tables contain information on privileges granted and privilegesobtained? Answer : USER_TAB_PRIVS_MADE. delete. but TRUNCATE operation cannot be rolled back. index. select. execute. !=. WHERE clause can be used with DELETE and not with TRUNCATE. .Question 18: State whether true or false. <>. update. references. USER_TAB_PRIVS_RECD Question 22: Which system table contains information on constraints on all the tablescreated? Answer : USER_CONSTRAINTS Question 23: What is the difference between TRUNCATE and DELETE commands? Answer : TRUNCATE is a DDL command whereas DELETE is a DML command. HenceDELETE operation can be rolled back. ^= 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.

Question 24: What command is used to create a table by copying the structure of anothertable? Answer : CREATE TABLE ..If the WHERE condition is true. . AS SELECT commandExplanation :To copy only the structure.CREATE TABLE NEWTABLE AS SELECT * FROM EXISTINGTABLE WHERE 1=2. the WHERE clause of the SELECT command should contain aFALSE statement as in the following. then all the rows or rows satisfying the condition will be copiedto the new table.

94343.":08943$9.331472.90090797:0471.9890/110703.08 3/0 00.3831472.709057.0089..3349-0 740/-.-0...3/  03.70.30/ 3807 &$#*%*!#'$* &$#*%*!#'$*#   ":08943.907 .9.43897.9.0087.:8079449078 3807 38079 :5/.9057.:90 .0-09003%#&%./03490908. -:9%#&%4507.439.-08.422.0084-9.390/43.422.3/070..9434357..3/%.3/ 3807 #'    ":08943.80    )..9.422.422..9 7010703.-08.439.889029..3/ 57.008411070/-90 #%.3-07.3/8:80/9409-.204507.390/.90 /0090 800.3-0:80/9%.422.-0-.909.889029.8%8.39843.943  3807 %7:0   ":08943.0%4507.943..  #.:80.3/8 3807 %#&%8.3/3499%#&%        ..943.90/ 3807 &$#* $%#%$   ":08943.3-0740/-.9.   ":08943 .

45390897:. 90748477488.422.:804190$%.3/8:80/94.-0-.9:7041.450/9490309.3.422.$ 89.-0 3807 #%% $$%.70.9.943%4.902039.43/943-0.454390 897:.9.43/943897:0 903.83901443 #%%%$$%  # $%%#190#.":08943.422.90.3/84:/.9:70 90#.3.3/5..349079.-0   .981390.439.

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.