Write an sql create table statement

Assignment Help Database Management System
Reference no: EM131724114

Use the following information for problems 4 - 10:

Tables: PET_OWNER (OwnerID, OwnerLastName, OwnerFirstName, OwnerPhone, OwnerEmail)

PET (PetID, PetName, PetType, PetBreed, PetDOB, OwnerID)

**Note: OwnerID is italicized to indicate the Foreign Key**

Data: Write an SQL CREATE TABLE statement to create the PET_OWNER table, with OwnerID as a surrogate key. Save as Create

PetOwner. Write a set of SQL INSERT statements to populate the PET_OWNER table with the data given above. Save as PopulatePetOwner. Write an SQL CREATE TABLE statement to create the PET table, with PetID as a surrogate key. Save as CreatePet.

Write a set of SQL INSERT statements to populate the PET table with the data given above.

Save as PopulatePet. Write an SQL statement to display the breed and type of all pets. Save as AllBreeds. Write an SQL statement to display the breed, and DOB of all pets having the type Cat.

Save as Cats. Write an SQL statement to display the first name, last name, and email of all owners, sorted in alphabetical order by last name.

Save as AlphaOwners. Write an SQL statement to display all the owners' names, with the first name in all lower case and the last name in all upper case. Save as UpperLower. Write an SQL statement to display the total number of pets.

Write an SQL statement to display the last name, first name and email of any owner who has a NULL value for OwnerPhone. (Note: there should be one owner who has a NULL value for OwnerPhone.) Save as PhoneNull.

Write an SQL statement to count the number of distinct breeds. Save as NumberOfBreeds. Write an SQL statement to display the names of all the dogs. Save as Dogs.

Verified Expert

Firstly I created a dummy database in Sequel Pro then created two tables named as PET_OWNER and PET having the same attributes as specified in assignment then inserted the values in tables as such way so that rest of the operation in the assignment can be performed easily and changes for different query should be prominent and thereafter performed rest of the SQL queries.

Reference no: EM131724114

Questions Cloud

Processing and arrival times on average waiting time : What is the impact of variability in processing and arrival times on average waiting time? Why does this occur?
Difference between principles and rules based standards : What is the difference between principles-based and rules-based accounting standards
Concept of moment of truth in a service context : Review the concept of moment of truth in a service context.
Explain how host x obtains the mac address of host z : Explain how host X obtains the MAC address of host Z. Describe how switch S handles the ARP request and response messages, and builds its switch table.
Write an sql create table statement : Write an SQL statement to display the total number of pets - Write a set of SQL INSERT statements to populate the PET table
Risk of colon cancer for frequent beer drinkers : If you were a frequent beer drinker and were worried about getting colon cancer, would it be more informative to you to know the risk of colon cancer.
Relationship between sex and handedness : Based on these observed data, do you think there is a relationship between sex and handedness in the population represented by this sample?
Technical competency domain of people : What HR functional areas within the technical competency domain of people do you believe will be impacted the most by future trends? How?
Features that predict relatively high levels of disclosure : ACC312 - International Managerial Accounting. Discuss characteristics or features that predict relatively high levels of disclosure in Mexico

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