Posts

Showing posts with the label SQL

CallAir case study - SQL queries, SQL reports, ERD

Your group is responsible for developing a database to support the fundamental data requirements of a customer call center for an established network service provider (includes landline, mobile and internet (broadband) services) - CallAir.  Due to increased competition in the market, CallAir. Due to increase competition in the market, CallAir is under increasing pressure to remain competitive and to rebuild its waning customer base. In order to do this, CallAir requires a unified view of all its customer data including customer personal information, bill details, marketing preferences, history with the organization providing CallAir with the ability to target customers with the right product/service offers. The following are the minimum project requirements: You are required to create a REPORT for CallAir documenting the database design and some preliminary results once the database is developed. This should include: 1.  Draw an Entity Relationship Diagram (ERO). Thi...

IT540Assignment3 Solution - Organization Access Database with queries

Write SQL statements (queries) to answer the following questions (Make sure to replace XXX with your initials!): 1. Write an SQL statement to list all columns and all rows for the table Service. Save the query results as XXXQ1. 2. Write an SQL statement to list LastName, FirstName, and CellPhone for all employees having an experience level of Master. Save the query results as XXXQ2 3. Write an SQL statement to list the names of employees who have worked on a property in New York. Use a subquery. Save the query results as XXXQ3. 4. Answer question 3 but use a join. Save the query results as XXXQ4. 5. Write an SQL statement to list the names of employees who have worked on a property owned by a corporation. You can use either subquery or join for this question. Save the query results as XXXQ5. 6. Write an SQL statement to show the first name and sum of hours worked for each employee. Save the query results as XXXQ6. 7. Write an SQL statement to show the sum of hours worked for ea...

Property & Property Damage Database Management Database Queries/Reports

After each question, construct the SQL statement that answers the question.  When specific attributes are not asked for, you may choose which attributes you wish to display. List all the information about the properties.  List information about damages including the street address. What were the different sources of damage (no duplicate reporting)? What was the total amount of damages assessed? What were the total damages for each property? List the damages sorted by location (where the damage was located not where the property was located). How many damages were reported? List the information about the properties whose zip codes start with 301. List the properties in Woodstock that were damaged. What properties were damaged (street address), what were the damages (description) and what was the amount of the damage? List the report information for inspectors Jones, Smith, White [use the IN keyword].  Which inspector(s) reported total damage amounts >$30,0...

[SOLVED] ICT285 Databases TMA 2017 Assignment 1 | Relational Algebra, Database Design & Implementation

Relational Algebra A database records information about athletes competing at the Olympics. An athlete competes for a particular country in one or more events. Events take place at a scheduled day and time in a particular venue. The result (rank) is recorded for all athletes in the final of the event. The medal (gold, silver or bronze) is also recorded for the medal winners in the event. Note that we are not considering team sports or heats in this example – only individuals competing in the finals. The schema for this database is as follows: (Note that primary keys are shown underlined, foreign keys in bold). ATHLETE ( AthleteNo , AthleteName, CountryName) COUNTRY ( CountryName , NumberOfCompetitors) EVENT (EventName, ScheduledStart, VenueName ) VENUE (VenueName, City, Capacity) FINAL ( AthleteNo , EventName , Rank, Medal) Provide relational algebra (NOT SQL) queries to find the following informaList the name and country of all athletes. List the event name and scheduled start time fo...

[SOLVED] ICT285 Databases TMA 2017 Assignment 1 | Relational Algebra, Database Design & Implementation

Relational Algebra A database records information about athletes competing at the Olympics. An athlete competes for a particular country in one or more events. Events take place at a scheduled day and time in a particular venue. The result (rank) is recorded for all athletes in the final of the event. The medal (gold, silver or bronze) is also recorded for the medal winners in the event. Note that we are not considering team sports or heats in this example – only individuals competing in the finals. The schema for this database is as follows: (Note that primary keys are shown underlined, foreign keys in bold). ATHLETE ( AthleteNo , AthleteName, CountryName) COUNTRY ( CountryName , NumberOfCompetitors) EVENT (EventName, ScheduledStart, VenueName ) VENUE (VenueName, City, Capacity) FINAL ( AthleteNo , EventName , Rank, Medal) Provide relational algebra (NOT SQL) queries to find the following informaList the name and country of all athletes. List the event name and scheduled...

ICT285 Databases TMA 2017 Assignment 2 | Design & Implementation & SQL

Case Study Re-read the description of the FastFoods4U case in Assignment 1 if you need to refresh your memory. Bill is pleased with your work so far and asked you to go on to implement your design. He has made a few clarifications and additions to the specifications that you should note: Bill’s trial of the system has been very successful and he now wants to broaden his service into other suburbs as well. He has also recruited more drivers, with the expectation that there will be drivers available in each suburb. However, customers will still only be able to have orders delivered from restaurants in the same suburb. Bill needs to know whether his meals are being delivered on time as per his advertising so the database will need to be able to provide information on requested and actual delivery times/dates. Bill is pleased with the way FF4U is developing and wants to make some further additions to the concept. He has decided to offer a service whereby customers will be able to see the ...

ICT285 Databases TMA 2017 Assignment 2 | Design & Implementation & SQL

Case Study Re-read the description of the FastFoods4U case in Assignment 1 if you need to refresh your memory. Bill is pleased with your work so far and asked you to go on to implement your design. He has made a few clarifications and additions to the specifications that you should note: Bill’s trial of the system has been very successful and he now wants to broaden his service into other suburbs as well. He has also recruited more drivers, with the expectation that there will be drivers available in each suburb. However, customers will still only be able to have orders delivered from restaurants in the same suburb. Bill needs to know whether his meals are being delivered on time as per his advertising so the database will need to be able to provide information on requested and actual delivery times/dates. Bill is pleased with the way FF4U is developing and wants to make some further additions to the concept. He has decided to offer a service whereby customers will be able to s...

[SOLVED] Database SQL Queries for Ordering System - Multiple Tables

Use this file as your template and place your SQL code {not the results} beneath each question. Use the following tables to answer the questions: CUSTOMERS(cid, cname, city, discnt) AGENTS(aid, aname, city, commission) PRODUCTS(pid, pname, city, quantity, price) ORDERS(ordno, ordmonth, cid, aid, pid, qty, dollars) Construct queries to answer the following: List the name of all products for which an order was placed. (w3schools --> SQL Inner Join) List the name of customers that ordered product ‘p07’ (W3schools-> SQL Inner Join & SQL Where) List name of agents that placed an order for customer c003 or customer c006 (w3schools-> SQL Inner Join and SQL IN -- or SQL And & Or) List name of customers that ordered product ‘p01’ through agent 'a01' (w3schools-> SQL Inner Join and SQL And & Or) List the name of each customer that placed an order, the pid of what they ordered and also the customers that did not place an order. (w3schools--> SQL Left Join) List ...

[SOLVED] Database SQL Queries for Ordering System - Multiple Tables

Use this file as your template and place your SQL code {not the results} beneath each question. Use the following tables to answer the questions: CUSTOMERS(cid, cname, city, discnt) AGENTS(aid, aname, city, commission) PRODUCTS(pid, pname, city, quantity, price) ORDERS(ordno, ordmonth, cid, aid, pid, qty, dollars) Construct queries to answer the following: List the name of all products for which an order was placed. (w3schools --> SQL Inner Join) List the name of customers that ordered product ‘p07’ (W3schools-> SQL Inner Join & SQL Where) List name of agents that placed an order for customer c003 or customer c006 (w3schools-> SQL Inner Join and SQL IN -- or SQL And & Or) List name of customers that ordered product ‘p01’ through agent 'a01' (w3schools-> SQL Inner Join and SQL And & Or) List the name of each customer that placed an order, the pid of what they ordered and also the customers that did not place an order. (w3schools--> SQL L...

[SOLVED] Database SQL Queries of Ordering Management System

Use this file as your template and place your SQL code {not the results} beneath each question. Use the following tables to answer the questions: CUSTOMERS(cid, cname, city, discnt) AGENTS(aid, aname, city, commission) PRODUCTS(pid, pname, city, quantity, price) ORDERS(ordno, ordmonth, cid, aid, pid, qty, dollars) Construct queries to answer the following: List the name [cname] of all customers List the order number [ordno] of all orders List all information about the products List the customer ids [cid] of all customers who placed an order. Do not list duplicates. List the customer names [cname] for customers in the city of Dallas. Buy now CONTACT DETAILS For any other questions or other tasks please feel free to contact me via email: mhassnainjamil@gmail.com via WhatsApp: +92-324-7042178 via skype: hassnainjamil1

[SOLVED] Database SQL Queries of Ordering Management System

Use this file as your template and place your SQL code {not the results} beneath each question. Use the following tables to answer the questions: CUSTOMERS(cid, cname, city, discnt) AGENTS(aid, aname, city, commission) PRODUCTS(pid, pname, city, quantity, price) ORDERS(ordno, ordmonth, cid, aid, pid, qty, dollars) Construct queries to answer the following: List the name [cname] of all customers List the order number [ordno] of all orders List all information about the products List the customer ids [cid] of all customers who placed an order. Do not list duplicates. List the customer names [cname] for customers in the city of Dallas. Buy now

[SOLVED] Ordering Management System Database SQL with ONE table

Ordering Management System Use this file as your template and place your SQL code {not the results} beneath each question. Use the following tables to answer the questions: CUSTOMERS(cid, cname, city, discnt) AGENTS(aid, aname, city, commission) PRODUCTS(pid, pname, city, quantity, price) ORDERS(ordno, ordmonth, cid, aid, pid, qty, dollars) Provide the SQL Queries that answer the following questions: List name and city for all customers (w3schools -> SQL Select) List name and price for all products (w3schools -> SQL Select) List the names of all agents in alphabetical order. (w3schools -> SQL ORDER BY) List all information for all Customers that are located in Dallas. (w3schools -> SQL Where) List all information for all Customers that are located in Dallas and have a discount greater than 9. (w3schools -> SQL And & Or) List pid of all products ordered – NO duplicates (w3schools -> SQL Distinct) List the sum in dollars of all orders (w3schools -> SQL Functions ...

[SOLVED] Ordering Management System Database SQL with ONE table

Ordering Management System Use this file as your template and place your SQL code {not the results} beneath each question. Use the following tables to answer the questions: CUSTOMERS(cid, cname, city, discnt) AGENTS(aid, aname, city, commission) PRODUCTS(pid, pname, city, quantity, price) ORDERS(ordno, ordmonth, cid, aid, pid, qty, dollars) Provide the SQL Queries that answer the following questions: List name and city for all customers (w3schools -> SQL Select) List name and price for all products (w3schools -> SQL Select) List the names of all agents in alphabetical order. (w3schools -> SQL ORDER BY) List all information for all Customers that are located in Dallas. (w3schools -> SQL Where) List all information for all Customers that are located in Dallas and have a discount greater than 9. (w3schools -> SQL And & Or) List pid of all products ordered – NO duplicates (w3schools -> SQL Distinct) List the sum in dollars of all orders (w3schools -...

[SOLVED] Restaurant Management System ERD

Requirements ERD (Entity Relationship Diagram) Identify each of the entities Identify2-3 attributes for each entity with a key attribute Name the relationships for each of the binary pairs Identify the degree of relationship for each of the binary pairs Decompose any many to many relationships Draw the completed Entity Relationship Model Case Study A restaurant manager wishes to set up a database to record the details of its customers, reservations for tables in the restaurant and the employees assigned to tables. For each customer, the database will record -- a customer number (unique), name, address, and phone number. The details to be recorded for each table include - table number (unique), capacity. Customers make reservations for tables. The requested time and date of the reservation is recorded along with a unique reservation number. Each reservation is made by one customer and books one table. A customer will make a number of reservations and each table can have many reservation...

[SOLVED] Restaurant Management System ERD

Requirements ERD (Entity Relationship Diagram) Identify each of the entities Identify2-3 attributes for each entity with a key attribute Name the relationships for each of the binary pairs Identify the degree of relationship for each of the binary pairs Decompose any many to many relationships Draw the completed Entity Relationship Model Case Study A restaurant manager wishes to set up a database to record the details of its customers, reservations for tables in the restaurant and the employees assigned to tables. For each customer, the database will record -- a customer number (unique), name, address, and phone number. The details to be recorded for each table include - table number (unique), capacity. Customers make reservations for tables. The requested time and date of the reservation is recorded along with a unique reservation number. Each reservation is made by one customer and books one table. A customer will make a number of reservations and each table can hav...

IT540Assignment3 Solution - Organization Access Database with queries

Write SQL statements (queries) to answer the following questions (Make sure to replace XXX with your initials!): 1. Write an SQL statement to list all columns and all rows for the table Service. Save the query results as XXXQ1. 2. Write an SQL statement to list LastName, FirstName, and CellPhone for all employees having an experience level of Master. Save the query results as XXXQ2 3. Write an SQL statement to list the names of employees who have worked on a property in New York. Use a subquery. Save the query results as XXXQ3. 4. Answer question 3 but use a join. Save the query results as XXXQ4. 5. Write an SQL statement to list the names of employees who have worked on a property owned by a corporation. You can use either subquery or join for this question. Save the query results as XXXQ5. 6. Write an SQL statement to show the first name and sum of hours worked for each employee. Save the query results as XXXQ6. 7. Write an SQL statement to show the sum of hours worked for each Exper...