0% found this document useful (0 votes)
2 views

TP4 - SQL -new

Uploaded by

fifa03fifa3
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

TP4 - SQL -new

Uploaded by

fifa03fifa3
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

INFORMATIQUE 3 ESMT SECOND YEAR

TP4 SQL
- Create a new database with the name “TP4_Name&Firstname_group”
You have the Article table of the database of a store selling computer articles:

1) Create a query in SQL (named Q1) to create this table, knowing that:
 The IDarticle is between 10000 and 52000. (this is the primary key of this table)
 The designation is a character chain of size between 5 characters and 30 characters.
 The IDshelve is between 01 and 99 (and it cannot be empty)
 The quantity on the shelves and in the warehouse never exceeds 300 articles.
 The IDsupplier consists of 4 digits or 5 digits. (no zero on the left)
(Note: You should economize as much storage space as possible from this table).
- Insert all above records in the product table (using datasheet view).
2) Using the syntax : “CREATE TABLE …” Create another query in SQL (named Q2) to create
another Article2 table with the same fields and properties of the Article table.
3) Create a query in SQL (named Q3) that inserts into the Article2 table the records from the Article
table that have a purchase price <= 900.00€.
4) The warehouse of this store has been changed with another warehouse that is larger than the
first and can store around 400 elements of each article. Write an SQL query (named Q4) to take
this change into consideration.
5) Write an SQL query (named Q5) to insert the following article:

6) Write an SQL query (named Q6) to update the data for article: “19900”:
 Its quantity in the deposit is: 400

You might also like