Advanced Management Console
VerifiedAdded on 2022/08/25
|35
|7601
|31
AI Summary
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/3c07a86c-456c-41d2-94c4-5a5e4e2de95c-page-1.webp)
Running head: AMC DATABASE SYSTEM
DATABASE SYSTEM OF AUSTRALIAN MANUFACTURING COMPANY
Name of the Student
Name of the University
Author Note
DATABASE SYSTEM OF AUSTRALIAN MANUFACTURING COMPANY
Name of the Student
Name of the University
Author Note
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/96e149f7-cee3-49d5-b384-536d4e5586ae-page-2.webp)
1AMC DATABASE SYSTEM
Table of Contents
Part A: AMC ERD.....................................................................................................................2
Part B: Normalised Schema.......................................................................................................3
Part C: Relational Schema Table:..............................................................................................3
AMCDB Database Schema..................................................................................................10
Table Structures of AMCDB...............................................................................................10
Data of the each tables:........................................................................................................16
Part D: SQL Queries:-..............................................................................................................26
Part E: Personal report:-...........................................................................................................32
Bibliography:............................................................................................................................34
Table of Contents
Part A: AMC ERD.....................................................................................................................2
Part B: Normalised Schema.......................................................................................................3
Part C: Relational Schema Table:..............................................................................................3
AMCDB Database Schema..................................................................................................10
Table Structures of AMCDB...............................................................................................10
Data of the each tables:........................................................................................................16
Part D: SQL Queries:-..............................................................................................................26
Part E: Personal report:-...........................................................................................................32
Bibliography:............................................................................................................................34
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/f8d13b91-4017-46a8-922c-71c9cf322435-page-3.webp)
2AMC DATABASE SYSTEM
Part A: AMC ERD
Figure 1: Entity Relationship Diagram AMC
(Source: Created by author)
Part A: AMC ERD
Figure 1: Entity Relationship Diagram AMC
(Source: Created by author)
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/5db9de8f-8644-4f2b-98b3-6410739ab87f-page-4.webp)
3AMC DATABASE SYSTEM
Part B: Normalised Schema
Figure 2: Normalised Schema of AMC
(Source: created by author)
Part C: Relational Schema Table:
Table name: Department
Field Name Data Type Length Key Constraints
department_number int 11 Primary Key
department_name varchar 20
Part B: Normalised Schema
Figure 2: Normalised Schema of AMC
(Source: created by author)
Part C: Relational Schema Table:
Table name: Department
Field Name Data Type Length Key Constraints
department_number int 11 Primary Key
department_name varchar 20
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/fa12b1ba-bfae-4e3e-b072-e9eb3883aa23-page-5.webp)
4AMC DATABASE SYSTEM
contact_no int 11
Table name: Employee
Field Name Data Type Length Key Constraints
employee_number int 11 Primary
first_name varchar 20
last_name varchar 20
address varchar 30
mobile_number int 11
TFN int 11
salary int 11
joining_date date No
department_number int 11 Foreign Key
contact_no int 11
Table name: Employee
Field Name Data Type Length Key Constraints
employee_number int 11 Primary
first_name varchar 20
last_name varchar 20
address varchar 30
mobile_number int 11
TFN int 11
salary int 11
joining_date date No
department_number int 11 Foreign Key
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/6c2cc48e-7aee-4aac-ad9e-57405f3a8e51-page-6.webp)
5AMC DATABASE SYSTEM
Table Name: Fulltime
Field Name Data Type Length Key Constraints
employee_number int 11
Primary Key,
Foreign key
salary int 11
Table Name: Inventory
Field Name Data Type Length
Key
Constraints
product_number int 11
Primary Key,
Foreign key
store_number int 11
Primary Key,
Foreign key
orderd int 11
available int 11
Table Name: Order
Field Name Data Type Length
Key
Constraints
order_number int 11 Primary
Table Name: Fulltime
Field Name Data Type Length Key Constraints
employee_number int 11
Primary Key,
Foreign key
salary int 11
Table Name: Inventory
Field Name Data Type Length
Key
Constraints
product_number int 11
Primary Key,
Foreign key
store_number int 11
Primary Key,
Foreign key
orderd int 11
available int 11
Table Name: Order
Field Name Data Type Length
Key
Constraints
order_number int 11 Primary
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/8730502c-20ef-418e-9cb1-8a5caffedb0d-page-7.webp)
6AMC DATABASE SYSTEM
product_number int 11 Foreign key
order_date date No
quantity int 11
patron_number int 11 Foreign Key
Table Name: Parttime
Field Name Data Type Length
Key
Constraints
employee_number int 11
Primary Key,
Foreign Key
hourly_rate int 11
Table Name: Patron
Field Name Data Type Length
Key
Constraints
patron_number int 11 Primary Key
first_name varchar 20
last_name varchar 20
product_number int 11 Foreign key
order_date date No
quantity int 11
patron_number int 11 Foreign Key
Table Name: Parttime
Field Name Data Type Length
Key
Constraints
employee_number int 11
Primary Key,
Foreign Key
hourly_rate int 11
Table Name: Patron
Field Name Data Type Length
Key
Constraints
patron_number int 11 Primary Key
first_name varchar 20
last_name varchar 20
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/f6270160-f319-4e15-8275-7d2e4a0d58b5-page-8.webp)
7AMC DATABASE SYSTEM
phone_number int 11
address varchar 30
Table Name: Payslip
Field Name Data Type Length Key Constraints
slip_number int 11 Primary Key
hour_worked int 11
employee_number int 11 Foreign key
gross_pay int 11
Table Name: Product
Field Name Data Type Length Key Constraints
product_number int 11 Primary Key
product_title varchar 20
brand varchar 20
price int 11
description varchar 50
Table Name: Store
Field Name Data Type Length Key Constraints
phone_number int 11
address varchar 30
Table Name: Payslip
Field Name Data Type Length Key Constraints
slip_number int 11 Primary Key
hour_worked int 11
employee_number int 11 Foreign key
gross_pay int 11
Table Name: Product
Field Name Data Type Length Key Constraints
product_number int 11 Primary Key
product_title varchar 20
brand varchar 20
price int 11
description varchar 50
Table Name: Store
Field Name Data Type Length Key Constraints
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/49fc22e1-33e2-4d8b-8714-329a9074c954-page-9.webp)
8AMC DATABASE SYSTEM
store_number int 11 Primary key
store_name varchar 30
store_address varchar 30
contact_no int 11
fax_no int 11
Table Name: Storemanager
Field Name Data Type Length Key Constraints
manager_id int 11 Primary key
first_name varchar 20
last_name varchar 20
contact_no int 11
store_number int 11 Foreign key
Table Name: Supervisor
Field Name Data Type Length Key Constraints
supervisor_id int 11 Primary key
store_number int 11 Primary key
store_name varchar 30
store_address varchar 30
contact_no int 11
fax_no int 11
Table Name: Storemanager
Field Name Data Type Length Key Constraints
manager_id int 11 Primary key
first_name varchar 20
last_name varchar 20
contact_no int 11
store_number int 11 Foreign key
Table Name: Supervisor
Field Name Data Type Length Key Constraints
supervisor_id int 11 Primary key
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/25eff0e2-1e01-4a6b-aa07-00214cf81b86-page-10.webp)
9AMC DATABASE SYSTEM
first_name varchar 20
last_name varchar 20
department_number int 11 Foreign key
Table name: Supplier
Field Name Data Type Length Key Constraints
supplier_id int 11 Primary key
supplier_name varchar 20
contact_no int 11
AMCDB Database Schema
first_name varchar 20
last_name varchar 20
department_number int 11 Foreign key
Table name: Supplier
Field Name Data Type Length Key Constraints
supplier_id int 11 Primary key
supplier_name varchar 20
contact_no int 11
AMCDB Database Schema
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/30520ed5-44f3-4920-a162-9b1f351da263-page-11.webp)
10AMC DATABASE SYSTEM
Table Structures of AMCDB
Product Table:
Describe product;
+----------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------+-------------+------+-----+---------+-------+
| product_number | int(11) | NO | PRI | NULL | |
| product_title | varchar(20) | NO | | NULL | |
| brand | varchar(20) | NO | | NULL | |
| price | int(11) | NO | | NULL | |
| description | varchar(50) | NO | | NULL | |
+----------------+-------------+------+-----+---------+-------+
Inventory Table:
Describe inventory;
+----------------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------+---------+------+-----+---------+-------+
| product_number | int(11) | NO | PRI | NULL | |
| store_number | int(11) | NO | PRI | NULL | |
| orderd | int(11) | NO | | NULL | |
| available | int(11) | NO | | NULL | |
+----------------+---------+------+-----+---------+-------+
Employee Table:
Table Structures of AMCDB
Product Table:
Describe product;
+----------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------+-------------+------+-----+---------+-------+
| product_number | int(11) | NO | PRI | NULL | |
| product_title | varchar(20) | NO | | NULL | |
| brand | varchar(20) | NO | | NULL | |
| price | int(11) | NO | | NULL | |
| description | varchar(50) | NO | | NULL | |
+----------------+-------------+------+-----+---------+-------+
Inventory Table:
Describe inventory;
+----------------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------+---------+------+-----+---------+-------+
| product_number | int(11) | NO | PRI | NULL | |
| store_number | int(11) | NO | PRI | NULL | |
| orderd | int(11) | NO | | NULL | |
| available | int(11) | NO | | NULL | |
+----------------+---------+------+-----+---------+-------+
Employee Table:
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/6389e472-0f24-4042-a893-f2802fc6e94a-page-12.webp)
11AMC DATABASE SYSTEM
Describe employee;
+-------------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+-------------+------+-----+---------+-------+
| employee_number | int(11) | NO | PRI | NULL | |
| first_name | varchar(20) | NO | | NULL | |
| last_name | varchar(20) | NO | | NULL | |
| address | varchar(30) | NO | | NULL | |
| mobile_number | int(11) | NO | | NULL | |
| TFN | int(11) | NO | | NULL | |
| salary | int(11) | NO | | NULL | |
| joining_date | date | NO | | NULL | |
| department_number | int(11) | NO | MUL | NULL | |
+-------------------+-------------+------+-----+---------+-------+
Department Table:
Describe department;
+-------------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+-------------+------+-----+---------+-------+
| department_number | int(11) | NO | PRI | NULL | |
| department_name | varchar(20) | NO | | NULL | |
| contact_no | int(11) | NO | | NULL | |
+-------------------+-------------+------+-----+---------+-------+
Store Table:
Describe employee;
+-------------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+-------------+------+-----+---------+-------+
| employee_number | int(11) | NO | PRI | NULL | |
| first_name | varchar(20) | NO | | NULL | |
| last_name | varchar(20) | NO | | NULL | |
| address | varchar(30) | NO | | NULL | |
| mobile_number | int(11) | NO | | NULL | |
| TFN | int(11) | NO | | NULL | |
| salary | int(11) | NO | | NULL | |
| joining_date | date | NO | | NULL | |
| department_number | int(11) | NO | MUL | NULL | |
+-------------------+-------------+------+-----+---------+-------+
Department Table:
Describe department;
+-------------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+-------------+------+-----+---------+-------+
| department_number | int(11) | NO | PRI | NULL | |
| department_name | varchar(20) | NO | | NULL | |
| contact_no | int(11) | NO | | NULL | |
+-------------------+-------------+------+-----+---------+-------+
Store Table:
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/1f06194a-12ca-4192-b173-946287c1a757-page-13.webp)
12AMC DATABASE SYSTEM
Describe store;
+---------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+-------+
| store_number | int(11) | NO | PRI | NULL | |
| store_name | varchar(30) | NO | | NULL | |
| store_address | varchar(30) | NO | | NULL | |
| contact_no | int(11) | NO | | NULL | |
| fax_no | int(11) | NO | | NULL | |
+---------------+-------------+------+-----+---------+-------+
Payslip table:
Describe payslip;
+-----------------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+---------+------+-----+---------+-------+
| slip_number | int(11) | NO | PRI | NULL | |
| hour_worked | int(11) | NO | | NULL | |
| employee_number | int(11) | NO | MUL | NULL | |
| gross_pay | int(11) | NO | | NULL | |
+-----------------+---------+------+-----+---------+-------+
Fulltime table:
Describe store;
+---------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+-------+
| store_number | int(11) | NO | PRI | NULL | |
| store_name | varchar(30) | NO | | NULL | |
| store_address | varchar(30) | NO | | NULL | |
| contact_no | int(11) | NO | | NULL | |
| fax_no | int(11) | NO | | NULL | |
+---------------+-------------+------+-----+---------+-------+
Payslip table:
Describe payslip;
+-----------------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+---------+------+-----+---------+-------+
| slip_number | int(11) | NO | PRI | NULL | |
| hour_worked | int(11) | NO | | NULL | |
| employee_number | int(11) | NO | MUL | NULL | |
| gross_pay | int(11) | NO | | NULL | |
+-----------------+---------+------+-----+---------+-------+
Fulltime table:
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/4a1cb98a-4857-423f-ac3e-a0fd7547145b-page-14.webp)
13AMC DATABASE SYSTEM
Describe fulltime;
+-----------------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+---------+------+-----+---------+-------+
| employee_number | int(11) | NO | PRI | NULL | |
| salary | int(11) | NO | | NULL | |
+-----------------+---------+------+-----+---------+-------+
Parttime table:
Describe parttime;
+-----------------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+---------+------+-----+---------+-------+
| employee_number | int(11) | NO | PRI | NULL | |
| hourly_rate | int(11) | NO | | NULL | |
+-----------------+---------+------+-----+---------+-------+
Supplier Table:
Describe supplier;
+---------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+-------+
| supplier_id | int(11) | NO | PRI | NULL | |
| supplier_name | varchar(20) | NO | | NULL | |
| contact_no | int(11) | NO | | NULL | |
+---------------+-------------+------+-----+---------+-------+
Describe fulltime;
+-----------------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+---------+------+-----+---------+-------+
| employee_number | int(11) | NO | PRI | NULL | |
| salary | int(11) | NO | | NULL | |
+-----------------+---------+------+-----+---------+-------+
Parttime table:
Describe parttime;
+-----------------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+---------+------+-----+---------+-------+
| employee_number | int(11) | NO | PRI | NULL | |
| hourly_rate | int(11) | NO | | NULL | |
+-----------------+---------+------+-----+---------+-------+
Supplier Table:
Describe supplier;
+---------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+-------+
| supplier_id | int(11) | NO | PRI | NULL | |
| supplier_name | varchar(20) | NO | | NULL | |
| contact_no | int(11) | NO | | NULL | |
+---------------+-------------+------+-----+---------+-------+
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/a26e49f5-09c7-44f6-8f75-a636c24c0c6e-page-15.webp)
14AMC DATABASE SYSTEM
Supervisor Table:
Describe supervisor;
+-------------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+-------------+------+-----+---------+-------+
| supervisor_id | int(11) | NO | PRI | NULL | |
| first_name | varchar(20) | NO | | NULL | |
| last_name | varchar(20) | NO | | NULL | |
| department_number | int(11) | NO | MUL | NULL | |
+-------------------+-------------+------+-----+---------+-------+
Patron Table:
Describe patron;
+---------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+-------+
| patron_number | int(11) | NO | PRI | NULL | |
| first_name | varchar(20) | NO | | NULL | |
| last_name | varchar(20) | NO | | NULL | |
| phone_number | int(11) | NO | | NULL | |
| address | varchar(30) | NO | | NULL | |
+---------------+-------------+------+-----+---------+-------+
Order_product Table:
Supervisor Table:
Describe supervisor;
+-------------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+-------------+------+-----+---------+-------+
| supervisor_id | int(11) | NO | PRI | NULL | |
| first_name | varchar(20) | NO | | NULL | |
| last_name | varchar(20) | NO | | NULL | |
| department_number | int(11) | NO | MUL | NULL | |
+-------------------+-------------+------+-----+---------+-------+
Patron Table:
Describe patron;
+---------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+-------+
| patron_number | int(11) | NO | PRI | NULL | |
| first_name | varchar(20) | NO | | NULL | |
| last_name | varchar(20) | NO | | NULL | |
| phone_number | int(11) | NO | | NULL | |
| address | varchar(30) | NO | | NULL | |
+---------------+-------------+------+-----+---------+-------+
Order_product Table:
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/6ff7ecfc-7078-46ed-8031-3c3479abb3e8-page-16.webp)
15AMC DATABASE SYSTEM
Describe order_product;
+---------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+-------+
| order_number | int(11) | NO | PRI | NULL | |
| product_number| int(11) | NO | | NULL | |
| order_date | date | NO | | NULL | |
| quantity | int(11) | NO | | NULL | |
| patron_number | int11) | NO | | NULL | |
Storemanager Table:
Describe storemanager;
+--------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+-------------+------+-----+---------+-------+
| manager_id | int(11) | NO | PRI | NULL | |
| first_name | varchar(20) | NO | | NULL | |
| last_name | varchar(20) | NO | | NULL | |
| contact_no | int(11) | NO | | NULL | |
| store_number | int(11) | NO | MUL | NULL | |
+--------------+-------------+------+-----+---------+-------+
Data of the each tables:
Department:
Describe order_product;
+---------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+-------+
| order_number | int(11) | NO | PRI | NULL | |
| product_number| int(11) | NO | | NULL | |
| order_date | date | NO | | NULL | |
| quantity | int(11) | NO | | NULL | |
| patron_number | int11) | NO | | NULL | |
Storemanager Table:
Describe storemanager;
+--------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+-------------+------+-----+---------+-------+
| manager_id | int(11) | NO | PRI | NULL | |
| first_name | varchar(20) | NO | | NULL | |
| last_name | varchar(20) | NO | | NULL | |
| contact_no | int(11) | NO | | NULL | |
| store_number | int(11) | NO | MUL | NULL | |
+--------------+-------------+------+-----+---------+-------+
Data of the each tables:
Department:
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/77bc509e-f0fe-482b-b0f3-c2b733f6dfa2-page-17.webp)
16AMC DATABASE SYSTEM
Select * from Department;
+-------------------+-----------------+------------+
| department_number | department_name | contact_no |
+-------------------+-----------------+------------+
| 1 | HR | 1254896357 |
| 2 | Accounts | 1245896324 |
| 3 | Sales | 1254896325 |
| 4 | Finance | 1245896325 |
+-------------------+-----------------+------------+
Employee:
Select * from employee;
+-----------------+------------+-----------+------------------+---------------+------------
+--------+--------------+-------------------+
| employee_number | first_name | last_name | address | mobile_number | TFN |
salary | joining_date | department_number |
+-----------------+------------+-----------+------------------+---------------+------------
+--------+--------------+-------------------+
| 1 | John | Smith | north Sydney | 895623142 | 1245896325 |
5000 | 2019-04-17 | 1 |
| 2 | jonathan | pattinson | new south weals | 569845236 | 1235489563 |
500 | 2019-11-06 | 2 |
| 3 | Amy | green | Melbourne | 658489635 | 1452358963 |
6000 | 2018-07-18 | 3 |
| 4 | Neo | clark | syedney | 546896325 | 1234589635 |
10000 | 2019-08-14 | 1 |
| 5 | anderson | binny | Victoria | 546896535 | 1235445896 |
200 | 2020-01-01 | 3 |
+-----------------+------------+-----------+------------------+---------------+------------
+--------+--------------+-------------------+
Fulltime:
Select * from Department;
+-------------------+-----------------+------------+
| department_number | department_name | contact_no |
+-------------------+-----------------+------------+
| 1 | HR | 1254896357 |
| 2 | Accounts | 1245896324 |
| 3 | Sales | 1254896325 |
| 4 | Finance | 1245896325 |
+-------------------+-----------------+------------+
Employee:
Select * from employee;
+-----------------+------------+-----------+------------------+---------------+------------
+--------+--------------+-------------------+
| employee_number | first_name | last_name | address | mobile_number | TFN |
salary | joining_date | department_number |
+-----------------+------------+-----------+------------------+---------------+------------
+--------+--------------+-------------------+
| 1 | John | Smith | north Sydney | 895623142 | 1245896325 |
5000 | 2019-04-17 | 1 |
| 2 | jonathan | pattinson | new south weals | 569845236 | 1235489563 |
500 | 2019-11-06 | 2 |
| 3 | Amy | green | Melbourne | 658489635 | 1452358963 |
6000 | 2018-07-18 | 3 |
| 4 | Neo | clark | syedney | 546896325 | 1234589635 |
10000 | 2019-08-14 | 1 |
| 5 | anderson | binny | Victoria | 546896535 | 1235445896 |
200 | 2020-01-01 | 3 |
+-----------------+------------+-----------+------------------+---------------+------------
+--------+--------------+-------------------+
Fulltime:
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/1a113b16-4c03-4e82-bd88-276db2185a5c-page-18.webp)
17AMC DATABASE SYSTEM
Select * from fulltime;
+-----------------+--------+
| employee_number | salary |
+-----------------+--------+
| 3 | 6000 |
| 4 | 10000 |
+-----------------+--------+
Parttime:
Select * from parttime;
+-----------------+-------------+
| employee_number | hourly_rate |
+-----------------+-------------+
| 1 | 300 |
| 2 | 200 |
| 5 | 500 |
+-----------------+-------------+
Store:
Select * from fulltime;
+-----------------+--------+
| employee_number | salary |
+-----------------+--------+
| 3 | 6000 |
| 4 | 10000 |
+-----------------+--------+
Parttime:
Select * from parttime;
+-----------------+-------------+
| employee_number | hourly_rate |
+-----------------+-------------+
| 1 | 300 |
| 2 | 200 |
| 5 | 500 |
+-----------------+-------------+
Store:
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/2bdf8730-868c-4932-b9de-12270853c1ca-page-19.webp)
18AMC DATABASE SYSTEM
Select * from store;
+--------------+------------+---------------+------------+---------+
| store_number | store_name | store_address | contact_no | fax_no |
+--------------+------------+---------------+------------+---------+
| 1 | ABC | 3 GeorGe | 895625486 | 12354 |
| 2 | XYZ | 9 george | 458965325 | 1542 |
| 3 | XXU | 13 victoria. | 58964523 | 125489 |
| 4 | GHK | 10 sydney | 895465623 | 1258963 |
| 5 | ASD | sydney | 894532569 | 12345 |
+--------------+------------+---------------+------------+---------+
Supplier:
Select * from supplier;
+-------------+---------------+------------+
| supplier_id | supplier_name | contact_no |
+-------------+---------------+------------+
| 1 | john wick | 123458965 |
| 2 | andrew smith | 124589635 |
| 3 | amily green | 1245896536 |
+-------------+---------------+------------+
Supervisor:
Select * from store;
+--------------+------------+---------------+------------+---------+
| store_number | store_name | store_address | contact_no | fax_no |
+--------------+------------+---------------+------------+---------+
| 1 | ABC | 3 GeorGe | 895625486 | 12354 |
| 2 | XYZ | 9 george | 458965325 | 1542 |
| 3 | XXU | 13 victoria. | 58964523 | 125489 |
| 4 | GHK | 10 sydney | 895465623 | 1258963 |
| 5 | ASD | sydney | 894532569 | 12345 |
+--------------+------------+---------------+------------+---------+
Supplier:
Select * from supplier;
+-------------+---------------+------------+
| supplier_id | supplier_name | contact_no |
+-------------+---------------+------------+
| 1 | john wick | 123458965 |
| 2 | andrew smith | 124589635 |
| 3 | amily green | 1245896536 |
+-------------+---------------+------------+
Supervisor:
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/f04fed40-bc88-4b50-b527-781dd60087fd-page-20.webp)
19AMC DATABASE SYSTEM
Select * from supervisor;
+---------------+------------+-----------+-------------------+
| supervisor_id | first_name | last_name | department_number |
+---------------+------------+-----------+-------------------+
| 1 | Alan | smith | 1 |
| 2 | Tim | cook | 4 |
| 3 | ana | tylor | 3 |
+---------------+------------+-----------+-------------------+
Storemanager :
Select * from storemanager;
+------------+------------+-----------+------------+--------------+
| manager_id | first_name | last_name | contact_no | store_number |
+------------+------------+-----------+------------+--------------+
| 1 | david | stark | 1245896325 | 1 |
| 2 | andrian | smith | 1245896536 | 5 |
| 3 | Stressy | may | 124589635 | 2 |
+------------+------------+-----------+------------+--------------+
Product:
Select * from supervisor;
+---------------+------------+-----------+-------------------+
| supervisor_id | first_name | last_name | department_number |
+---------------+------------+-----------+-------------------+
| 1 | Alan | smith | 1 |
| 2 | Tim | cook | 4 |
| 3 | ana | tylor | 3 |
+---------------+------------+-----------+-------------------+
Storemanager :
Select * from storemanager;
+------------+------------+-----------+------------+--------------+
| manager_id | first_name | last_name | contact_no | store_number |
+------------+------------+-----------+------------+--------------+
| 1 | david | stark | 1245896325 | 1 |
| 2 | andrian | smith | 1245896536 | 5 |
| 3 | Stressy | may | 124589635 | 2 |
+------------+------------+-----------+------------+--------------+
Product:
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/66531cb6-066c-4bf3-ad32-f09d4c84d4bb-page-21.webp)
20AMC DATABASE SYSTEM
Select * from product;
+----------------+---------------+-------+-------+-------------+
| product_number | product_title | brand | price | description |
+----------------+---------------+-------+-------+-------------+
| 1 | Shirt | Zara | 100 | Green Shirt |
| 2 | Pant | GUCCI | 500 | Black Jeans |
| 3 | Hat | GUCCI | 200 | Black Hat |
| 4 | Shoe | NIKE | 90 | white shoe |
| 5 | Shoe | GUCCI | 1000 | yellow shoe |
+----------------+---------------+-------+-------+-------------+
Payslip:
Select * from payslip;
+-------------+-------------+-----------------+-----------+
| slip_number | hour_worked | employee_number | gross_pay |
+-------------+-------------+-----------------+-----------+
| 1 | 7 | 3 | 6000 |
| 2 | 3 | 5 | 200 |
| 3 | 6 | 2 | 500 |
| 4 | 9 | 4 | 10000 |
+-------------+-------------+-----------------+-----------+
Patron:
Select * from product;
+----------------+---------------+-------+-------+-------------+
| product_number | product_title | brand | price | description |
+----------------+---------------+-------+-------+-------------+
| 1 | Shirt | Zara | 100 | Green Shirt |
| 2 | Pant | GUCCI | 500 | Black Jeans |
| 3 | Hat | GUCCI | 200 | Black Hat |
| 4 | Shoe | NIKE | 90 | white shoe |
| 5 | Shoe | GUCCI | 1000 | yellow shoe |
+----------------+---------------+-------+-------+-------------+
Payslip:
Select * from payslip;
+-------------+-------------+-----------------+-----------+
| slip_number | hour_worked | employee_number | gross_pay |
+-------------+-------------+-----------------+-----------+
| 1 | 7 | 3 | 6000 |
| 2 | 3 | 5 | 200 |
| 3 | 6 | 2 | 500 |
| 4 | 9 | 4 | 10000 |
+-------------+-------------+-----------------+-----------+
Patron:
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/754f6cf2-0178-4a0b-a14e-53c2c72e5dc8-page-22.webp)
21AMC DATABASE SYSTEM
Select * from patron;
+---------------+------------+-----------+--------------+--------------+
| patron_number | first_name | last_name | phone_number | address |
+---------------+------------+-----------+--------------+--------------+
| 1 | Alan | Green | 369856321 | Sydney |
| 2 | nancy | gee | 458965365 | western AUS |
| 3 | emily | tylor | 69856458 | north sydney |
| 4 | paul | anderson | 421548965 | NSW |
+---------------+------------+-----------+--------------+--------------+
Inventory:
Select * from inventory;
+----------------+--------------+--------+-----------+
| product_number | store_number | orderd | available |
+----------------+--------------+--------+-----------+
| 1 | 3 | 8 | 2 |
| 2 | 2 | 1 | 9 |
| 3 | 1 | 6 | 0 |
| 4 | 5 | 6 | 4 |
| 5 | 4 | 9 | 0 |
+----------------+--------------+--------+-----------+
order_product:
Select * from patron;
+---------------+------------+-----------+--------------+--------------+
| patron_number | first_name | last_name | phone_number | address |
+---------------+------------+-----------+--------------+--------------+
| 1 | Alan | Green | 369856321 | Sydney |
| 2 | nancy | gee | 458965365 | western AUS |
| 3 | emily | tylor | 69856458 | north sydney |
| 4 | paul | anderson | 421548965 | NSW |
+---------------+------------+-----------+--------------+--------------+
Inventory:
Select * from inventory;
+----------------+--------------+--------+-----------+
| product_number | store_number | orderd | available |
+----------------+--------------+--------+-----------+
| 1 | 3 | 8 | 2 |
| 2 | 2 | 1 | 9 |
| 3 | 1 | 6 | 0 |
| 4 | 5 | 6 | 4 |
| 5 | 4 | 9 | 0 |
+----------------+--------------+--------+-----------+
order_product:
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/0be2d1a9-ad2c-4a6a-9d38-cdf20fcbf2bd-page-23.webp)
22AMC DATABASE SYSTEM
Select * from order_product;
+--------------+----------------+------------+----------+---------------+
| order_number | product_number | order_date | quantity | patron_number |
+--------------+----------------+------------+----------+---------------+
| 1 | 3 | 2020-01-08 | 5 | 3 |
| 2 | 2 | 2020-01-01 | 1 | 1 |
| 3 | 1 | 2019-12-11 | 1 | 4 |
| 4 | 4 | 2019-12-12 | 2 | 2 |
+--------------+----------------+------------+----------+---------------+
Referral Integrity Constraints in order_product table:
Referral Integrity Constraints in employee table:
Select * from order_product;
+--------------+----------------+------------+----------+---------------+
| order_number | product_number | order_date | quantity | patron_number |
+--------------+----------------+------------+----------+---------------+
| 1 | 3 | 2020-01-08 | 5 | 3 |
| 2 | 2 | 2020-01-01 | 1 | 1 |
| 3 | 1 | 2019-12-11 | 1 | 4 |
| 4 | 4 | 2019-12-12 | 2 | 2 |
+--------------+----------------+------------+----------+---------------+
Referral Integrity Constraints in order_product table:
Referral Integrity Constraints in employee table:
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/72460402-3f5b-4e3c-a728-339a33a77152-page-24.webp)
23AMC DATABASE SYSTEM
Referral Integrity Constraints in fulltime table:
Referral Integrity Constraints in inventory table:
Referral Integrity Constraints in parttime table:
Referral Integrity Constraints in fulltime table:
Referral Integrity Constraints in inventory table:
Referral Integrity Constraints in parttime table:
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/11ccf045-996f-4f29-b5e5-910ab6d65156-page-25.webp)
24AMC DATABASE SYSTEM
Referral Integrity Constraints in payslip table:
Referral Integrity Constraints in storemanager table:
Referral Integrity Constraints in supervisor table:
Referral Integrity Constraints in payslip table:
Referral Integrity Constraints in storemanager table:
Referral Integrity Constraints in supervisor table:
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/82bc771f-7477-42c8-a0b4-288119013ec2-page-26.webp)
25AMC DATABASE SYSTEM
Part D: SQL Queries:-
Question 1:
SQL: SELECT patron_number, CONCAT (first_name,' ', last_name) AS Name,
phone_number,address FROM patron ORDER by patron_number DESC;
Output: +---------------+---------------+--------------+--------------+
| patron_number | Name | phone_number | address |
+---------------+---------------+--------------+--------------+
| 4 | paul anderson | 421548965 | NSW |
| 3 | emily tylor | 69856458 | north sydney |
| 2 | nancy gee | 458965365 | western AUS |
| 1 | Alan Green | 369856321 | Sydney |
+---------------+---------------+--------------+--------------+
Question 2:
SQL: SELECT * FROM product WHERE price<100;
Output: +----------------+---------------+-------+-------+-------------+
| product_number | product_title | brand | price | description |
+----------------+---------------+-------+-------+-------------+
| 4 | Shoe | NIKE | 90 | white shoe |
+----------------+---------------+-------+-------+-------------+
Question 3:
Part D: SQL Queries:-
Question 1:
SQL: SELECT patron_number, CONCAT (first_name,' ', last_name) AS Name,
phone_number,address FROM patron ORDER by patron_number DESC;
Output: +---------------+---------------+--------------+--------------+
| patron_number | Name | phone_number | address |
+---------------+---------------+--------------+--------------+
| 4 | paul anderson | 421548965 | NSW |
| 3 | emily tylor | 69856458 | north sydney |
| 2 | nancy gee | 458965365 | western AUS |
| 1 | Alan Green | 369856321 | Sydney |
+---------------+---------------+--------------+--------------+
Question 2:
SQL: SELECT * FROM product WHERE price<100;
Output: +----------------+---------------+-------+-------+-------------+
| product_number | product_title | brand | price | description |
+----------------+---------------+-------+-------+-------------+
| 4 | Shoe | NIKE | 90 | white shoe |
+----------------+---------------+-------+-------+-------------+
Question 3:
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/6d3d569c-f401-4aa4-9ef2-e9d1e2aeb321-page-27.webp)
26AMC DATABASE SYSTEM
SQL: select op.product_number,p.product_title, p.price, op.quantity,
(price*quantity) as Total_amount,order_number from order_product
op,product p where order_number='1005'
Output: +----------------+---------------+-------+----------+--------------
+--------------+
| product_number | product_title | price | quantity | Total_amount
| order_number |
+----------------+---------------+-------+----------+--------------
+--------------+
| 5 | Shirt | 100 | 1 | 100
| 1005 |
| 5 | Pant | 500 | 1 | 500
| 1005 |
| 5 | Hat | 200 | 1 | 200
| 1005 |
| 5 | Shoe | 90 | 1 | 90
| 1005 |
| 5 | Shoe | 1000 | 1 | 1000
| 1005 |
+----------------+---------------+-------+----------+--------------
+--------------+
Question 4:
SQL: select store_name,fax_no,store_address from store where BINARY
store_address LIKE '%GeorGe%';
Output: +------------+--------+---------------+
| store_name | fax_no | store_address |
+------------+--------+---------------+
| ABC | 12354 | 3 GeorGe |
+------------+--------+---------------+
Question 5:
SQL: select op.product_number,p.product_title, p.price, op.quantity,
(price*quantity) as Total_amount,order_number from order_product
op,product p where order_number='1005'
Output: +----------------+---------------+-------+----------+--------------
+--------------+
| product_number | product_title | price | quantity | Total_amount
| order_number |
+----------------+---------------+-------+----------+--------------
+--------------+
| 5 | Shirt | 100 | 1 | 100
| 1005 |
| 5 | Pant | 500 | 1 | 500
| 1005 |
| 5 | Hat | 200 | 1 | 200
| 1005 |
| 5 | Shoe | 90 | 1 | 90
| 1005 |
| 5 | Shoe | 1000 | 1 | 1000
| 1005 |
+----------------+---------------+-------+----------+--------------
+--------------+
Question 4:
SQL: select store_name,fax_no,store_address from store where BINARY
store_address LIKE '%GeorGe%';
Output: +------------+--------+---------------+
| store_name | fax_no | store_address |
+------------+--------+---------------+
| ABC | 12354 | 3 GeorGe |
+------------+--------+---------------+
Question 5:
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/5ad86bca-5a40-4c6b-9f08-ba975132132f-page-28.webp)
27AMC DATABASE SYSTEM
SQL: SELECT* from order_product where order_number >2;
Output: +--------------+----------------+------------+----------
+---------------+
| order_number | product_number | order_date | quantity |
patron_number |
+--------------+----------------+------------+----------
+---------------+
| 3 | 1 | 2019-12-11 | 1 |
4 |
| 4 | 4 | 2019-12-12 | 2 |
2 |
| 1005 | 5 | 2020-01-05 | 1 |
2 |
+--------------+----------------+------------+----------
+---------------+
Question 6:
SQL: select c.patron_number, c.address, concat(c.first_name,'
',c.last_name) as Name from patron c
left outer join order_product o
on c.patron_number=o.order_number where o.order_number is null ;
Output: Empty set (0.000 sec)
Every patron order minimum 1 product that is the reason this query retrieve empty field.
Question 7:
SQL: SELECT* from order_product where order_number >2;
Output: +--------------+----------------+------------+----------
+---------------+
| order_number | product_number | order_date | quantity |
patron_number |
+--------------+----------------+------------+----------
+---------------+
| 3 | 1 | 2019-12-11 | 1 |
4 |
| 4 | 4 | 2019-12-12 | 2 |
2 |
| 1005 | 5 | 2020-01-05 | 1 |
2 |
+--------------+----------------+------------+----------
+---------------+
Question 6:
SQL: select c.patron_number, c.address, concat(c.first_name,'
',c.last_name) as Name from patron c
left outer join order_product o
on c.patron_number=o.order_number where o.order_number is null ;
Output: Empty set (0.000 sec)
Every patron order minimum 1 product that is the reason this query retrieve empty field.
Question 7:
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/a5dbf37c-b38d-44a6-be51-7e1c83b82013-page-29.webp)
28AMC DATABASE SYSTEM
SQL: select e.employee_number,e.first_name, e.last_name,
d.department_name,s.store_name from employee e, department d,store s
where e.employee_number=s.store_number and
d.department_number=e.department_number;
Output: +-----------------+------------+-----------+-----------------
+------------+
| employee_number | first_name | last_name | department_name |
store_name |
+-----------------+------------+-----------+-----------------
+------------+
| 1 | John | Smith | HR | ABC
|
| 4 | Neo | clark | HR | GHK
|
| 2 | jonathan | pattinson | Accounts | XYZ
|
| 3 | Amy | green | Sales | XXU
|
| 5 | anderson | binny | Sales | ASD
|
+-----------------+------------+-----------+-----------------
+------------+
5 rows in set (0.001 sec)
Question 8:
SQL: select e.employee_number,e.first_name, e.last_name,
d.department_name,s.store_name from employee e, department d,store s
where e.employee_number=s.store_number and
d.department_number=e.department_number;
Output: +-----------------+------------+-----------+-----------------
+------------+
| employee_number | first_name | last_name | department_name |
store_name |
+-----------------+------------+-----------+-----------------
+------------+
| 1 | John | Smith | HR | ABC
|
| 4 | Neo | clark | HR | GHK
|
| 2 | jonathan | pattinson | Accounts | XYZ
|
| 3 | Amy | green | Sales | XXU
|
| 5 | anderson | binny | Sales | ASD
|
+-----------------+------------+-----------+-----------------
+------------+
5 rows in set (0.001 sec)
Question 8:
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/a3b55fe3-bef3-416c-87f5-a310c01b25a4-page-30.webp)
29AMC DATABASE SYSTEM
SQL: SELECT * from store
inner JOIN
employee on store.store_number=employee.employee_number
Output: +--------------+------------+---------------+------------+---------
+-----------------+------------+-----------+------------------
+---------------+------------+--------+--------------
+-------------------+
| store_number | store_name | store_address | contact_no | fax_no
| employee_number | first_name | last_name | address |
mobile_number | TFN | salary | joining_date |
department_number |
+--------------+------------+---------------+------------+---------
+-----------------+------------+-----------+------------------
+---------------+------------+--------+--------------
+-------------------+
| 1 | ABC | 3 GeorGe | 895625486 | 12354
| 1 | John | Smith | north Sydney |
895623142 | 1245896325 | 5000 | 2019-04-17 | 1
|
| 2 | XYZ | 9 george | 458965325 | 1542
| 2 | jonathan | pattinson | new south weals |
569845236 | 1235489563 | 500 | 2019-11-06 | 2
|
| 3 | XXU | 13 victoria. | 58964523 | 125489
| 3 | Amy | green | Melbourne |
658489635 | 1452358963 | 6000 | 2018-07-18 | 3
|
| 4 | GHK | 10 sydney | 895465623 | 1258963
| 4 | Neo | clark | syedney |
546896325 | 1234589635 | 10000 | 2019-08-14 | 1
|
| 5 | ASD | sydney | 894532569 | 12345
| 5 | anderson | binny | Victoria |
546896535 | 1235445896 | 200 | 2020-01-01 | 3
|
+--------------+------------+---------------+------------+---------
+-----------------+------------+-----------+------------------
+---------------+------------+--------+--------------
+-------------------+
5 rows in set (0.001 sec)
Question 9:
SQL: SELECT * from store
inner JOIN
employee on store.store_number=employee.employee_number
Output: +--------------+------------+---------------+------------+---------
+-----------------+------------+-----------+------------------
+---------------+------------+--------+--------------
+-------------------+
| store_number | store_name | store_address | contact_no | fax_no
| employee_number | first_name | last_name | address |
mobile_number | TFN | salary | joining_date |
department_number |
+--------------+------------+---------------+------------+---------
+-----------------+------------+-----------+------------------
+---------------+------------+--------+--------------
+-------------------+
| 1 | ABC | 3 GeorGe | 895625486 | 12354
| 1 | John | Smith | north Sydney |
895623142 | 1245896325 | 5000 | 2019-04-17 | 1
|
| 2 | XYZ | 9 george | 458965325 | 1542
| 2 | jonathan | pattinson | new south weals |
569845236 | 1235489563 | 500 | 2019-11-06 | 2
|
| 3 | XXU | 13 victoria. | 58964523 | 125489
| 3 | Amy | green | Melbourne |
658489635 | 1452358963 | 6000 | 2018-07-18 | 3
|
| 4 | GHK | 10 sydney | 895465623 | 1258963
| 4 | Neo | clark | syedney |
546896325 | 1234589635 | 10000 | 2019-08-14 | 1
|
| 5 | ASD | sydney | 894532569 | 12345
| 5 | anderson | binny | Victoria |
546896535 | 1235445896 | 200 | 2020-01-01 | 3
|
+--------------+------------+---------------+------------+---------
+-----------------+------------+-----------+------------------
+---------------+------------+--------+--------------
+-------------------+
5 rows in set (0.001 sec)
Question 9:
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/debb35f4-a6e7-488a-b462-8df7ff4652ce-page-31.webp)
30AMC DATABASE SYSTEM
SQL: select order_number, order_date from order_product where
order_date>= '2017-06-30' and order_date <='2018-07-01';
Output: +--------------+------------+
| order_number | order_date |
+--------------+------------+
| 258 | 2017-12-30 |
| 1933 | 2017-10-19 |
+--------------+------------+
2 rows in set (0.000 sec)
Question 10:
SQL: select patron_number, count(quantity) as Orders from order_product
GROUP by patron_number;
Output: +---------------+--------+
| patron_number | Orders |
+---------------+--------+
| 1 | 1 |
| 2 | 2 |
| 3 | 2 |
| 4 | 2 |
+---------------+--------+
4 rows in set (0.000 sec)
Question 11:
SQL: select order_number, order_date from order_product where
order_date>= '2017-06-30' and order_date <='2018-07-01';
Output: +--------------+------------+
| order_number | order_date |
+--------------+------------+
| 258 | 2017-12-30 |
| 1933 | 2017-10-19 |
+--------------+------------+
2 rows in set (0.000 sec)
Question 10:
SQL: select patron_number, count(quantity) as Orders from order_product
GROUP by patron_number;
Output: +---------------+--------+
| patron_number | Orders |
+---------------+--------+
| 1 | 1 |
| 2 | 2 |
| 3 | 2 |
| 4 | 2 |
+---------------+--------+
4 rows in set (0.000 sec)
Question 11:
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/4815c05c-c5a7-426a-be76-33f3067c589d-page-32.webp)
31AMC DATABASE SYSTEM
SQL: SELECT order_number,order_date, quantity as number_of_product from
order_product ORDER BY order_number DESC;
Output: +--------------+------------+-------------------+
| order_number | order_date | number_of_product |
+--------------+------------+-------------------+
| 1933 | 2017-10-19 | 1 |
| 1005 | 2020-01-05 | 1 |
| 258 | 2017-12-30 | 2 |
| 4 | 2019-12-12 | 2 |
| 3 | 2019-12-11 | 1 |
| 2 | 2020-01-01 | 1 |
| 1 | 2020-01-08 | 5 |
+--------------+------------+-------------------+
7 rows in set (0.000 sec)
Part E: Personal report:-
As a database developer, I developed a prototype of a database for AMC. This
database will help AMC to maintain their work and manage their workloads. I am creating a
total thirteen tables for AMC. These tables are able to record every detail for AMC.
STORE MANAGER Table can record the ID number, the manager’s first and last
names, contact number and number of the stores where store manager is assigned for. The
supervisor table contains the supervisor’s id, name and department number. The employee
table can hold every detail of an employee. Every details of the product order store in the
order table. AMC has many departments and every department information can be stored in
the department table. An employee of AMC can be a parttime employee or a full-time
employee. Every supplier details store on the supplier table. Every employee gets their
payslip at the end of the month and the PAYSLIP table stores every information about
SQL: SELECT order_number,order_date, quantity as number_of_product from
order_product ORDER BY order_number DESC;
Output: +--------------+------------+-------------------+
| order_number | order_date | number_of_product |
+--------------+------------+-------------------+
| 1933 | 2017-10-19 | 1 |
| 1005 | 2020-01-05 | 1 |
| 258 | 2017-12-30 | 2 |
| 4 | 2019-12-12 | 2 |
| 3 | 2019-12-11 | 1 |
| 2 | 2020-01-01 | 1 |
| 1 | 2020-01-08 | 5 |
+--------------+------------+-------------------+
7 rows in set (0.000 sec)
Part E: Personal report:-
As a database developer, I developed a prototype of a database for AMC. This
database will help AMC to maintain their work and manage their workloads. I am creating a
total thirteen tables for AMC. These tables are able to record every detail for AMC.
STORE MANAGER Table can record the ID number, the manager’s first and last
names, contact number and number of the stores where store manager is assigned for. The
supervisor table contains the supervisor’s id, name and department number. The employee
table can hold every detail of an employee. Every details of the product order store in the
order table. AMC has many departments and every department information can be stored in
the department table. An employee of AMC can be a parttime employee or a full-time
employee. Every supplier details store on the supplier table. Every employee gets their
payslip at the end of the month and the PAYSLIP table stores every information about
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/59fb7a05-b999-419c-b75e-6b071369c49e-page-33.webp)
32AMC DATABASE SYSTEM
employee’s payment details. AMC produces many products and every product details store in
the product table. A patron can buy many products. This database can record every patron's
details in the patron table.
I hope this database will help AMC to increase their productivity, and it will help
AMC authority to manage their workloads.
employee’s payment details. AMC produces many products and every product details store in
the product table. A patron can buy many products. This database can record every patron's
details in the patron table.
I hope this database will help AMC to increase their productivity, and it will help
AMC authority to manage their workloads.
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/7f44effa-8759-4fdd-bf03-b81edb1ab87b-page-34.webp)
33AMC DATABASE SYSTEM
Bibliography:
Bailis, P., Fekete, A., Franklin, M.J., Ghodsi, A., Hellerstein, J.M. and Stoica, I., 2014.
Coordination avoidance in database systems. Proceedings of the VLDB Endowment, 8(3),
pp.185-196.
Bursztyn, D., Goasdoué, F. and Manolescu, I., 2016. Teaching an RDBMS about ontological
constraints. Proceedings of the VLDB Endowment, 9(12), pp.1161-1172.
Cortez, K.I.G., 2014. NERD: A Learning Tool for Database Normalization and ERD
Development (Doctoral dissertation).
Elmasri, R. and Navathe, S., 2017. Fundamentals of database systems. Pearson.
Gahi, Y., Guennoun, M. and El-Khatib, K., 2015. A secure database system using
homomorphic encryption schemes. arXiv preprint arXiv:1512.03498.
Harrington, J.L., 2016. Relational database design and implementation. Morgan Kaufmann.
Kraska, T., Alizadeh, M., Beutel, A., Chi, E.H., Ding, J., Kristo, A., Leclerc, G., Madden, S.,
Mao, H. and Nathan, V., 2019. Sagedb: A learned database system.
Letkowski, J., 2015. Doing database design with MySQL. Journal of Technology
Research, 6, p.1.
Link, S. and Prade, H., 2019. Relational database schema design for uncertain
data. Information Systems, 84, pp.88-110.
Malecha, G., Morrisett, G., Shinnar, A. and Wisnesky, R., 2010, January. Toward a verified
relational database management system. In ACM Sigplan Notices (Vol. 45, No. 1, pp. 237-
248). ACM.
Bibliography:
Bailis, P., Fekete, A., Franklin, M.J., Ghodsi, A., Hellerstein, J.M. and Stoica, I., 2014.
Coordination avoidance in database systems. Proceedings of the VLDB Endowment, 8(3),
pp.185-196.
Bursztyn, D., Goasdoué, F. and Manolescu, I., 2016. Teaching an RDBMS about ontological
constraints. Proceedings of the VLDB Endowment, 9(12), pp.1161-1172.
Cortez, K.I.G., 2014. NERD: A Learning Tool for Database Normalization and ERD
Development (Doctoral dissertation).
Elmasri, R. and Navathe, S., 2017. Fundamentals of database systems. Pearson.
Gahi, Y., Guennoun, M. and El-Khatib, K., 2015. A secure database system using
homomorphic encryption schemes. arXiv preprint arXiv:1512.03498.
Harrington, J.L., 2016. Relational database design and implementation. Morgan Kaufmann.
Kraska, T., Alizadeh, M., Beutel, A., Chi, E.H., Ding, J., Kristo, A., Leclerc, G., Madden, S.,
Mao, H. and Nathan, V., 2019. Sagedb: A learned database system.
Letkowski, J., 2015. Doing database design with MySQL. Journal of Technology
Research, 6, p.1.
Link, S. and Prade, H., 2019. Relational database schema design for uncertain
data. Information Systems, 84, pp.88-110.
Malecha, G., Morrisett, G., Shinnar, A. and Wisnesky, R., 2010, January. Toward a verified
relational database management system. In ACM Sigplan Notices (Vol. 45, No. 1, pp. 237-
248). ACM.
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
![Document Page](https://desklib.com/media/document/docfile/pages/amc-database-system/2024/09/29/00b98731-08d0-466a-bfb5-d50f29a62e76-page-35.webp)
34AMC DATABASE SYSTEM
Nixon, R., 2014. Learning PHP, MySQL & JavaScript: With jQuery, CSS & HTML5. "
O'Reilly Media, Inc.".
Piza‐Dávila, H.I., Gutiérrez‐Preciado, L.F. and Ortega‐Guzmán, V.H., 2017. An educational
software for teaching database normalization. Computer Applications in Engineering
Education, 25(5), pp.812-822.
Ren, K., Thomson, A. and Abadi, D.J., 2014. An evaluation of the advantages and
disadvantages of deterministic database systems. Proceedings of the VLDB
Endowment, 7(10), pp.821-832.
Satoto, K.I., Isnanto, R.R., Kridalukmana, R. and Martono, K.T., 2016, October. Optimizing
MySQL database system on information systems research, publications and community
service. In 2016 3rd International Conference on Information Technology, Computer, and
Electrical Engineering (ICITACEE) (pp. 1-5). IEEE.
service. In 2016 3rd International Conference on Information Technology, Computer, and
Electrical Engineering (ICITACEE) (pp. 1-5). IEEE.
Nixon, R., 2014. Learning PHP, MySQL & JavaScript: With jQuery, CSS & HTML5. "
O'Reilly Media, Inc.".
Piza‐Dávila, H.I., Gutiérrez‐Preciado, L.F. and Ortega‐Guzmán, V.H., 2017. An educational
software for teaching database normalization. Computer Applications in Engineering
Education, 25(5), pp.812-822.
Ren, K., Thomson, A. and Abadi, D.J., 2014. An evaluation of the advantages and
disadvantages of deterministic database systems. Proceedings of the VLDB
Endowment, 7(10), pp.821-832.
Satoto, K.I., Isnanto, R.R., Kridalukmana, R. and Martono, K.T., 2016, October. Optimizing
MySQL database system on information systems research, publications and community
service. In 2016 3rd International Conference on Information Technology, Computer, and
Electrical Engineering (ICITACEE) (pp. 1-5). IEEE.
service. In 2016 3rd International Conference on Information Technology, Computer, and
Electrical Engineering (ICITACEE) (pp. 1-5). IEEE.
1 out of 35
Related Documents
![[object Object]](/_next/image/?url=%2F_next%2Fstatic%2Fmedia%2Flogo.6d15ce61.png&w=640&q=75)
Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
© 2024 | Zucol Services PVT LTD | All rights reserved.