Interconnecting and expressing data lab

Assignment Help Database Management System
Reference no: EM132843723

Lab - Interconnecting and Expressing Data

Overview of the Lab

One purpose of this lab it to teach you how to meaningfully relate data and to answer questions using related data, using SQL. In the prior lab you learned the fundamentals creating and using tables to store data, which is a good introduction to SQL. To be effective, however, you need to know how to work with relationships that naturally occur in the data you work with.

Section - Relating Data

1. Create the Pizza and Toppings tables, including all of their columns, datatypes, and constraints, including the foreign key constraint.

2. Insert at least four rows into the Pizza table. Two of the rows should have the values given below.

Pizza 1
name = Plain
date_available = 6/15/2020
price = $9.99
toppings: This pizza has no toppings at all.

Pizza 2
name = Veggie Delight
date_available = 9/20/2020
price = $10.99
toppings: You choose at least two veggie toppings for this pizza.

For the other rows, you insertthe ids, names, dates, prices, and toppings of your choosing (maybe you have some favorite pizzas?). Ensure that these other pizzas you create have at least two toppings.

Lastly, insert an extra topping that is not associated with any pizza, that is, the topping should be an "add-on" which is not included inany pizza's standardtoppings.

Select all rows in both tables to view what you inserted.

3. As an exercise, attempt to insert a topping that references a pizza that doesn't exist. Summarize:
a. why the insertion failed, and
b. how you would interpret the error message from your RDBMS so that you know that the error indicates the Pizza reference is invalid.

Section - Advanced Data Expression

4. Indicate the final values for each of the Boolean expressions below. You must show your work for full credit, by showing the value of each operation step-by-step.
a. (true AND false) OR (true AND true)
b. (true OR false) AND NOT(false OR false) AND (false AND true)
c. NOT((false OR true) AND NOT(true AND true) AND (false OR true))

5. Address the following scenarios.
a. Any pizza matching the following condition is considered a signature pizza for the pizza shop: Any pizza, except for the "Plain" pizza, that is available on or after 5/1/2020, with a price of $9.50 or higher, is a signature pizza.Write a query that shows the name and price of all signature pizzas.
b. The pizza shop also has one flagship pizza that sets the shop apart from other pizza shops. First, define your own conditions for this flagship pizza, making sure the conditions include the name, date, and price. Then write a query that shows the name and price of the flagship pizza. It's fine if you'd like to insert another row of pizzas to become your flagship pizza.

6. Address the following.
a. In your own words, describe the advantages of using a calculated column, when compared to placing the calculation in queries.
b. Define a new generated column named special_price, which gives a lower price for the pizza for when the pizza shop offers specials (such as on holidays or during weekly specials). You determine the percentage or fixed value discount for the special price. Then write a query that lists out the name of all pizzas, along with their regular and special prices.
c. Address #16a again in a different way. First, define a generated column named is_signature on the Pizza table, which indicates whether it's a signature pizza or not. Then write aquery that lists only the signature pizzas. Include relevant columns in the result.

Attachment:- Interconnecting and Expressing Data.rar

Reference no: EM132843723

Questions Cloud

What is the probability that kobe misses the second shot : What is the probability that kobe misses the second shot in a streak, if he has a cold hand and independent probabilities?
Calculate project npv using a discount rate of seven percent : Calculate the? project's NPV using a discount rate of 7 percent. Carson Trucking is considering whether to expand its regional service center in? Mohab.
Describe semantic and procedural memories : Describe working memory. Based on research in cognitive psychology, discuss how much information you can hold in working memory at one time.
What is the approximate percentage of students : The maximum possible score on the test was 120, while the mean score was 74 and the standard deviation was 9. (34,13.5,2.35,0.15)
Interconnecting and expressing data lab : Create the Pizza and Toppings tables, including all of their columns, datatypes, and constraints, including the foreign key constraint
Evaluating supply chain design decisions : Why is it important to consider uncertainty when evaluating supply chain design decisions?
What is the accounts receivable balance after the change : Compute the accounts receivable balance before and after the change in the cash discount policy. Determine the average daily sales.
Describe relationship between racism and privilege : Post an explanation of the relationship between racism and privilege. Furthermore, explain how the concepts of racism and privilege relate to.
Identify multiple obstacles based on your evaluation : Identify multiple obstacles based on your evaluation. Consider skill gaps, organizational culture, and resources among other things

Reviews

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

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