You are on page 1of 9

ASSIGNMENT

Q1. What is SQL? What are the various features of SQL? SQL is a standard language for accessing databases. It is used to interact with the DBMS. SQL is used to access and manipulate data in mySQL, SQLserver, MsAccess, Oracle, Sybase, DB2 and other database system. There are various features of SQL listed below :1. 2. 3. 4. 5. 6. 7. 8. 9. Execute quesries against a database. Retrieve data from a database. Insert a record in a database. Update, delete record in a database. Create new databases. Create new tables in a database. Create stored procedures in a database. Create views in a database. Set permissions on tables, procedures and views.

Q2. Describe various Data types used in SQL. There are several datatypes were used in SQL like number for integers, varchar for characters/alphabets, numeric for decimal digits, date for inserting date, long for storing large amount of data (around 2GB). Q3. Create table student with fields : ROLL_NO, NAME, COURSE, and Date Of Birth and display its structure . INPUT create table Pawan_kumar_086_student ( roll_no number(10), name varchar(20), course varchar(5), date_of_birth date); desc Pawan_kumar_086_student

OUTPUT

Q4. Modify the structure of student table as follows(display structure after every modification): a. Add two new columns named Section and Contact No. b. Change the size of course column by 2 points. c. Remove the column Date of Birth. INPUT a. alter table Pawan_kumar_086 add ( section varchar(7),

contact_no number(10) ); OUTPUT

INPUT b. alter table Pawan_kumar_086 modify ( course varchar(9) ); OUTPUT

INPUT c. alter table Pawan_kumar_086 drop column dob; OUTPUT

Q5. Create table Employee with fields: EmpID, EmpName, Designation and Date of Joining. INPUT create table Employe_e ( EmpID number(10),

EmpName varchar(20), Designation varchar(10), Date_of_joining date ); OUTPUT

Q6. Modify the structure of Employee table as follows(display structure after every modification): a. Add a new column Salary. b. Change the size of Salary by 5 points and Name by 10 Points. c. Remove the fields Designation and Date of Joining. INPUT a. alter table Employe_e

add( Salary number(7) ); OUTPUT

INPUT b. alter table Employe_e modify ( salary number(12), EmpName varchar(30)

);

desc Employe_e OUTPUT

INPUT c. alter table Employe_e drop (designation, date_of_joining);

desc Employe_e OUTPUT

You might also like