






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Instructions and SQL queries for creating and managing tables and records in a database system. The examples include creating tables named 'Employee', 'station', 'CATEGORIES', 'CUSTOMERS', and 'PRODUCTS', and inserting records into each table. The document also demonstrates deleting a table and updating records.
Typology: Assignments
1 / 11
This page cannot be seen from the preview
Don't miss anything!







create database Abdullah_Falak create table Employee ( customer_id int, cust_name varchar( 50 ), city varchar( 20 ), grade int,
Employee_id int ) insert into Employee(customer_id,cust_name,city,grade,Employee_id) values( 11 ,'Asad','Multan', 20 , 33 ) insert into Employee(customer_id,cust_name,city,grade,Employee_id) values( 12 ,'Anas','Lahore', 22 , 34 ) insert into Employee(customer_id,cust_name,city,grade,Employee_id) values( 13 ,'Haris','Islamabad', 23 , 35 ) insert into Employee(customer_id,cust_name,city,grade,Employee_id) values( 14 ,'Mazz','Pindi', 24 , 36 ) insert into Employee(customer_id,cust_name,city,grade,Employee_id) values( 15 ,'Faheem','Sargoda', 25 , 37 ) select * from Employee Drop table Employee
create database shop create table CATEGORIES ( category_id int, categoryname varchar( 20 ) ) INSERT INTO CATEGORIES (category_id, categoryname) VALUES ( 25 , 'Deli') INSERT INTO CATEGORIES (category_id, categoryname) VALUES( 50 , 'Produce') INSERT INTO CATEGORIES (category_id, categoryname) VALUES( 75 , 'Bakery') INSERT INTO CATEGORIES (category_id, categoryname) VALUES( 100 , 'General Merchandise')
create table CUSTOMERS ( customer_id int, last_name varchar( 20 ), first_name varchar( 20 ), favorite_website varchar( 30 ) ) INSERT INTO CUSTOMERS (customer_id, last_name, first_name, favorite_website) VALUES( 4000 , 'Jackson', 'Joe', 'techonthenet.com') INSERT INTO CUSTOMERS (customer_id, last_name, first_name, favorite_website) VALUES( 5000 , 'Smith', 'Jane', 'digminecraft.com') INSERT INTO CUSTOMERS (customer_id, last_name, first_name, favorite_website) VALUES( 6000 , 'Ferguson', 'Samantha', 'bigactivities.com') INSERT INTO CUSTOMERS (customer_id, last_name, first_name, favorite_website) VALUES( 7000 , 'Reynolds', 'Allen', 'checkyourmath.com') INSERT INTO CUSTOMERS (customer_id, last_name, first_name, favorite_website) VALUES( 8000 , 'Anderson', 'Paige',Null) INSERT INTO CUSTOMERS (customer_id, last_name, first_name, favorite_website) VALUES( 9000 , 'Johnson', 'Derek', 'techonthenet.com')
create table SUPPLIERS (
supplier_id int, supplier_name varchar( 20 ), city varchar( 20 ), state varchar( 20 ) ) INSERT INTO SUPPLIERS (supplier_id, supplier_name, city, state) VALUES( 100 , 'Microsoft', 'Redmond', 'Washington') INSERT INTO SUPPLIERS (supplier_id, supplier_name, city, state) VALUES( 200 , 'google' , 'Mountain View', 'California') INSERT INTO SUPPLIERS (supplier_id, supplier_name, city, state) VALUES( 300 , 'Oracle', 'Redwood City', 'California') INSERT INTO SUPPLIERS (supplier_id, supplier_name, city, state) VALUES( 400 , 'Kimberly-Clark', 'Irving', 'Texas') INSERT INTO SUPPLIERS (supplier_id, supplier_name, city, state) VALUES( 500 , 'Tyson Foods', 'Springdale', 'Arkansas') INSERT INTO SUPPLIERS (supplier_id, supplier_name, city, state) VALUES( 600 , 'SC Johnson', 'Racine', 'Wisconsi') INSERT INTO SUPPLIERS (supplier_id, supplier_name, city, state) VALUES( 700 , 'Dole Food Company', 'Westlake Village', 'California') INSERT INTO SUPPLIERS (supplier_id, supplier_name, city, state) VALUES( 800 , 'Flowers Foods', 'Thomasville', 'Georgia') INSERT INTO SUPPLIERS (supplier_id, supplier_name, city, state) VALUES( 900 , 'Electronic Arts', 'Redwood City', 'California')
delete from CATEGORIES where category_id= 75 update CUSTOMERS set first_name='Jhon' where customer_id= 7000 ALTER TABLE PRODUCTS DROP COLUMN product_price; alter table PRODUCTS ADD discount int update PRODUCTS set product_name='alex' where product_id= 7