Problem 1- customers with certain list patternsnbspproblem

Assignment Help Database Management System
Reference no: EM13347931

Problem 1- Customers with certain list patterns

 

Problem description

 

  • You are provided with four tables in Order_Supplier schema in the following screen. The table details are:
  • Customer (cust_id, Fname, Lname, phonenumber, city) - contains information about the customers
  • OrderDetails (order_ID, order_Date, cust_id, quantity, item_ID) - has details about the orders placed
  • supplier (supplierID, supplierName, City, email, Phone) - gives all the information about the suppliers
  • Item(itemID, itemName, supplier_ID, price, minQTY, maxQTY) - consists of details about the items
  • You are required to write an SQL Query based on the tables given.

 

 

 

 

Tasks

 

You are supposed to write an SQL Query to display the details of all the customers, who do not have the alphabet e in their LNAME.

 

Note 1: The column(s) to be displayed in the result or output should be cust_id, Fname, Lname,  phonenumber, and city only.

 

Note2: While writing the SQL query, you are required to write the table name as schemaname.tablename (For example employee.projectDetails where employee is schemaname and projectDetails is tablename).

 

 

Problem 2- Employees without joining date details

 

Problem description

 

  • You are provided with two tables in EMP Schema in the following screen. The table details are:
  • Employee (EmpNo, Name, DOJ) - contains information about each employee
  • EmployeeProject(EmpNo, Projectid, StartDate, Location, TotalHoursOnProject) - has details about the projects that each employee is working on. Note: Default date format is dd-mm-yyyy.
  • You are required to write an SQL Query based on the tables given.

 

 

 

 

Tasks

 

You are required to write an SQL Query to fetch the names of all the employees whose date of joining is not known.

 

Note 1:  The column(s) to be displayed in the result or output should be 'Name' only.

 

Problem 3- Author's of a book

 

Problem description

 

  • You are provided with three tables in LMS schema in the following screen. The table details are:
  • Book (Title, Author, Publisher) - holds information about books.
  • Library(BranchCode, Librarian, Address) - contains details of the libraries
  • Book_library(BranchCode, Title, Copies) - has information about the books in all the libraries
  • You are required to write an SQL Query based on the tables given.

 

 

 

Tasks

 

You are required to write an SQL query to get the author of the book "The Alchemist"

 

Note 1: The column(s) to be displayed in the result or output should be Author only.

 

Note 2: While writing the SQL query, you are required to write the table name as schemaname.tablename (For example employee.projectDetails where employee is schemaname and projectDetails is tablename).

 

 

Problem 4- Total Number of Tests

 

Problem description

 

  • You are provided with Five tables in Assessments Schema in the following screen. The table details are:
  • Questions (QuestionID, QuestionDesc, Option1, Option2, Option3, Option4, Answer, DifficultyLevel, Marks, SubjectId, TopicId)
  • Subjects (SubjectID, SubjectName)
  • Topics (TopicID, TopicName, SubjectID)
  • Tests (TestID, TestName, TestDuration)
  • TestQuestions(TestID, QuestionID)
  • The database schema called Assessments is used as part of a portal that conducts various tests.

 

a. Questions table contains the set of test questions. Questions are all multiple-choice, single answer.

 

    This table contains several fields:

 

    QuestionID: Unique to a question (primary key)

 

    QuestionDesc: Question description

 

    Option1: Answer option-1 of the multiple choices

 

    Option2: Answer option-2 of the multiple choices

 

    Option3: Answer option-3 of the multiple choices

 

    Option4: Answer option-4 of the multiple choices

 

    Answer: Correct Answer (contains 1/2/3/4)

 

    Difficulty Level: Contains one of the value 1/2/3/4/5 (1- Easiest, 5 - Hardest)

 

    Marks: Marks for the question

 

    SubjectID: Subject Id

 

    TopicID: Topic Id.

 

b. Subjects table contains the set of subjects. Each subject forms a unique row in the table.

 

c. Topics table contains the set of topics. Each topic forms a unique row in the table and is mapped uniquely to one SubjectID.

 

d. Tests table contains the set of tests in the portal. Each test forms a unique row in the Tests table.

 

e. TestQuestions: A test contains 1-N questions. Each question of the test forms a unique row in the TestQuestions table.

 

 

You are required to write an SQL Query based on the tables given.

 

 

Tasks

 

You are required to write a SQL query to get the total number of tests present in the test table

 

Note1: The columns to be displayed in the result or output should be total only

 

Note 2: While writing SQL query, you are required to write the tablename as schemaname.tablename( for example employee.projectDetails where employee is the schemaname and projectDetails is the tablename)

 

Problem 5- Topics under a subject

 

Problem description

 

The database schema called Assessments is used as part of a portal that conducts various tests.

 

a. Questions table contains the set of test questions. Questions are all multiple-choice, single answer.

 

    This table contains several fields:

 

    QuestionID: Unique to a question (primary key)

 

    QuestionDesc: Question description

 

    Option1: Answer option-1 of the multiple choices

 

    Option2: Answer option-2 of the multiple choices

 

    Option3: Answer option-3 of the multiple choices

 

    Option4: Answer option-4 of the multiple choices

 

    Answer: Correct Answer (contains 1/2/3/4)

 

    Difficulty Level: Contains one of the value 1/2/3/4/5 (1- Easiest, 5 - Hardest)

 

    Marks: Marks for the question

 

    SubjectID: Subject Id

 

    TopicID: Topic Id.

 

 

b. Subjects table contains the set of subjects. Each subject forms a unique row in the table.

 

c. Topics table contains the set of topics. Each topic forms a unique row in the table and is mapped uniquely to one SubjectID.

 

d. Tests table contains the set of tests in the portal. Each test forms a unique row in the Tests table.

 

e. TestQuestions: A test contains 1-N questions. Each question of the test forms a unique row in the TestQuestions table.

 

 

You are required to write an SQL Query based on the tables given.

 

 

Tasks

 

You are required to write an SQL query to get all the topics that come under the subject, RDBMS.

 

Note1: The column(s) to be displayed in the result or output should be  TopicName only.

 

Note2: While writing SQL query, you are required to write the table name as schemaname.tablename (For example employee.projectDetails where employee is schemaname and projectDetails is tablename).

 

Problem 6 - Program with minimum duration

 

Problem description

 

A TV network has several channels. Each channel is in a particular language. Each channel has a number and a name. There are programs in the channel everyday and each program is for a certain duration in minutes. There are different packages comprising of a set of channels. A channel can be in one or more package. Each package has a cost in Indian Rupees.

 

 

  • Based on above description, you are provided with four tables in TV_Cable Schema in the following screen. The table details are:
  • Channels (ChannelNumber,ChannelName,Language)
  • Programs (ProgramID,ProgramName,Channelnumber,Duration,Category)
  • Packages (PackageID, PackageName, Cost)
  • Package_channel(PackageID,ChannelNumber)
  • You are required to write an SQL Query based on the tables given.

 

You are required to write an SQL Query based on the tables given.

 

 

Tasks

 

You are reuqired to write an SQL query to get the name of the programs of minimum duration.

 

Note1: The column(s) to be displayed in the result or output should be  ProgramName  only.

 

Problem 7 - Old home policies

 

Problem description

 

An insurance firm issues policies across both life and non-life products. The non-life products include car and home policies. Auto policies in terms are categorized under comprehensive coverage, Third party, fire and accident coverages.

 

  • The key tables in the schema include
  •  Policy_Codes: Holds data on the policy type code and the policy type name. Each policy type name is associated with a unique policy code.
  • Policy_Types: Has details on the various policies, their type  and policy value. Each policy has a type and an associated value.
  • Car_Policies: Has details on the car policy type, manufacturer, model and car sale date.
  • Car_Policy_Types: Has data on the various car policy types and their names. Each car policy type code is associated with a unique code.
  • Home_Policies: Has details on the address and date the house was built. Every home policy is associated with an address and a date on which the house was built.
  • Addresses: Has data on the individual addresses.
  • Life_Policies: Has data on the medical evaluation and prescription for each life policy.
  • By using the above tables, Write an sql statement to find what is the percentage of home policies which are from the state of Arizona out of all Home policies by Policy Value.

 

 

Tasks

 

 Write a sql statement to find what is the percentage of home policies which are from the state of Arizona out of all Home policies by Policy Value.

 

Note 1: The corresponding column in the result must be called PERCENTAGE.

 

Problem 8 - Order with most Items

 

Problem description

 

An online merchant stocks multiple products that he offers to customers. Once the customer makes an order, the order is processed and the products delivered in one or more shipments. The following are the tables used in the schema.

 

  • In certain cases an order might be serviced through multiple shipments- with sub-order going from 1 to n indicating number of splits of the order
  • Customers: Has details on the customer and method to contact the customer (mail, phone or phone message)
  • Tracking_Order: Has details on the status of each order.
  • Order_Status_Codes: Has a mapping between order status code and its description.
  • Shipments: Has details of the shipment details for each order. An order might be serviced through multiple shipments.
  • Order_Items: This has details on the constituents of each sub-order in terms of products and the number of units of each product.
  • Products: This has details on each of the products, the product id and the product name.
  • Invoices: Stores the invoice no, invoice date and details of the invoice.
  • The number of units in an sub-order = (product 1*quantity of product 1) + (product 2*quantity of product 2) +  (product 3*quantity of product 3) etc.
  • By using the above tables, write an SQL statement to identify the order(s) that contain the most number of items. (List order id and number of items).

 

Tasks

 

Write an SQL statement to identify order(s) that contain the most number of items. (List order id and number of items).

 

Note 1: The corresponding columns in the result must be called order_ID and NumberOfItems.

 

Problem 9 - Tracking Order

 

Problem description

 

An online merchant stocks multiple products that he offers to customers. Once the customer makes an order, the order is processed and the products delivered in one or more shipments. The following are the tables used in the schema.

 

  • In certain cases an order might be serviced through multiple shipments- with sub-order going from 1 to n indicating number of splits of the order:
  • Customers: Has details on the customer and method to contact the customer (mail, phone or phone message)
  • Tracking_Order: Has details on the status of each order.
  • Order_Status_Codes: Has a mapping between order status code and its description.
  • Shipments: Has details of the shipment details for each order. An order might be serviced through multiple shipments.
  • Order_Items: This has details on the constituents of each sub-order in terms of products and the number of units of each product.
  • Products: This has details on each of the products, the product id and the product name.
  • Invoices: Stores the invoice no, invoice date and details of the invoice.

 

The number of units in an sub-order = (product 1*quantity of product 1) + (product 2*quantity of product 2) +  (product 3*quantity of product 3) etc.

 

Tasks

 

Write an SQL statement to list each order_status_code with number of orders. (List order_status_code, number of orders)

 

Note1: The corresponding columns in the result must be called order_status_code and numberOfOrders.

 

Problem 10 - Branch Manager with maximum number of sales persons

 

Problem description

 

A car dealership in the Minneapolis-St Paul area of Minnesota, US has presence in multiple branch locations in the area. Each of the branch locations has a branch manager and a set of salespeople. A single location would have multiple vehicles. The dealership stocks cars from various leading manufacturers. The dealership also has data on the features available in each car. Some cars have multiple features, while other cars might not have any features.

 

The following are the tables in the schema:

 

  • Branches: This table has data on the branch code, branch name and branch manager code at each location.
  • Sales_People: This table has detail on the sales person code, branch location and sales person name and contact details. A single branch will have multiple sales people mapped to it.
  • Car_Manufacturers: This table has detail on car manufacturers and relationships the dealership has with them.
  • Vehicles:  This table has details on individual vehicles- manufacturer name and color
  • Inventory: This table captures detail of the cars present in each location. The inventory_ID maps every vehicleID to a single branch location
  • Actual_Car_Features: This table has details on multiple features mapped to a single vehicle. A car might have none, one or multiple features.
  • By using the above tables, write an SQL statement to identify the branch manager who has the maximum number of salespersons reporting to him (Branch Manager, branch location, number of salespeople)

 

 

Tasks

 

Write an SQL statement to identify the branch manager who has the maximum number of salespersons reporting to him (Branch Manager, branch location, number of salespeople)

 

Note 1: The corresponding columns in the result must be called branch_location , branch_Manager_Code and numberofsalespeople.

 

Note 2: While writing SQL query, you are required to write the table name as schemaname.tablename (For example Dealership.Branches where Dealership is schemaname  and Branches is tablename).

 

By using the above tables, Write an SQL statement to list each order_status_code with number of orders. (List order_status_code, number of orders)

Reference no: EM13347931

Questions Cloud

Case study requirement and analysis disciplines through : case study requirement and analysis disciplines through analysis of a simple case study and to express the results
Choose two 2 companies in the same industry and work on the : choose two 2 companies in the same industry and work on the criterion mentioned below a business overviewb
Design and implement a c program and structure diagram for : design and implement a c program and structure diagram for the subsequent specification.show writing and calling
Question 1a busy landscaping supplies company sells wood : question 1a busy landscaping supplies company sells wood chips for garden mulch. the mulch is sold by the cubic metre
Problem 1- customers with certain list patternsnbspproblem : problem 1- customers with certain list patternsnbspproblem descriptionnbsp you are provided with four tables in
Analyzing a case studyas just mentioned the purpose of the : analyzing a case studyas just mentioned the purpose of the case study is to let you apply the concepts youve learned
Create four classes accountjava checkingjava savingsjava : create four classes account.java checking.java savings.java and accountarray.java.1. for the account class createtwo
Question 1unfocused books is a discount retail bookshop : question 1unfocused books is a discount retail bookshop that has three departments non-fiction fiction and childrens
Excellent performance for lvmh in 2012 lvmh moeumlt : excellent performance for lvmh in 2012 lvmh moeumlt hennessy louis vuitton the worlds biggest luxury products group

Reviews

Write a Review

Database Management System Questions & Answers

  Design database in microsoft access

Access will draw a line, called_______a, between matching fields in two tables, indicating that the tables are related. You can then select fields from either table. Access joins the tables automatically.

  Graph the bond yield to maturity

Identify two possibly mispriced bond issues, one overpriced and one underpriced. and graph the bond yield to maturity (YTM) on the y-axis of an XY-scatter plot, with the bond to maturity in years on the x-axis.

  Types of keys used in relational database

Explain with examples different types of keys used in relational database, how they help relating different tables.

  What is recovering database via rollforward

What is Recovering a database via rollforward? What is aim of transaction log? What is contained in transaction log?

  Recognize input data required for each of processes

Recognize input data required for each of processes. Recognize logical name for each data output item and kind of data output (real number, integer, text).

  Develop proposal recommends hardware and operating system

Papers should be created with Microsoft Word in the APA style and have a title page, short abstract, body, and conclusion. The "body" should contain between 1000 and 2000 words and include a Works Cited page, headers and other appropriate APA ele..

  What do you mean by data base scheme

Database Questions:  What do you mean by data base scheme?  What do you mean by cardinality ratio?   What do you mean by degree of relation?

  Define the concept of reduction factor

Summarize briefly how to make use of indexes such as B+ tree or a hash indexes in selection, projection, and join operations?

  Create a clustered index on the groupid column

Write the CREATE INDEX statements to create a clustered index on the GroupID column and a nonclustered index on the IndividuallD column of the GroupMembership table.

  Difference between obsolescent and redundant stocks

Difference between obsolescent and redundant stocks

  Expressions in tuple relational calculus and domain relation

Consider the relational database described in Problem Give expressions in tuple relational calculus and domain relational calculus for each of the following queries: Find all the companies that have offices in all the cities in which company C2..

  Design diagram data warehouse using star schema

Assume that data warehouse consists of three dimensions time, customer, and cell phone plan, and two measures number of calls and cell phone bill. Sketch a schema diagram for above data warehouse using star schema.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd