10
 Mohammed Yassine LABIB Dr. Nasser ASSEM CSC 3326 L Assignment LAB 2 I- Introduction: The content of this lab was mainly on getting used to fundamental SQL queries which are the creating table by adding the related attributes, also to update, delete, of add instances. Also, how to link instances of different tables (Product table, Vendor table…) and to display only the needed data. 1) Creating Tables and Adding the instances: Vendor Table + added instances:

LABIB LabAssignment2

Embed Size (px)

DESCRIPTION

SQL database lab report 2

Citation preview

I-  Introduction:
The content of this lab was mainly on getting used to fundamental SQL queries which are
the creating table by adding the related attributes, also to update, delete, of add instances.
Also, how to link instances of different tables (Product table, Vendor table…) and to display
only the needed data.
Vendor Table + added instances:
 
2)  Trying to insert some rows with duplicate primary key.
The instance do not add up, and a message is shown displaying: Violation o primary key.
4)
 
D. Basic Data Retrieval:
a) Writing the SQL statement to retrieve all the data in the vendor table (all the attributes): 
Products:
Vendors
Mohammed Yassine LABIB
Dr. Nasser ASSEM
CSC 3326 L
b) Writing the SQL statement to retrieve the code, description, quantity on hand, price and vendor of all
products. 
2)
 
Mohammed Yassine LABIB
Dr. Nasser ASSEM
CSC 3326 L
b) Writing the SQL statement to list all invoices issued before the 15th of March 2006: 
c) Writing the SQL statement to list all products whose cost is at least 100 DHS 
 
2)
3)
The v_code assigned to the products was Updated to the new v_code number.
F. Deleting Data from a Table.
 
Mohammed Yassine LABIB
Dr. Nasser ASSEM
CSC 3326 L
3) I deleted the vendor code 25565, I noticed when displaying the Products table that “NULL” replaced
the v_code attribute of the product associated.
G. Lab Assignment: