Question

Create a T-SQL statement that creates a table called Owner as part of a schema called...

Create a T-SQL statement that creates a table called Owner as part of a schema called PetStore. Create the table to have 2 columns with the following criteria:

  • Column OwnerID of type int. Make this column an IDENTITY column starting with seed 1 and incrementing by 1
  • Column OwnerName of type varchar and length 50, not null
0 0
Add a comment Improve this question Transcribed image text
Answer #1

>use PetStore;

>create table Owner(OwnerID int IDENTITY(1,1),OwnerName varchar(50) NOT NULL);

basically, syntax of creating identity is:identity(seed,increment)

seed:

Is the value that is used for the very first row loaded into the table.

increment:

Is the incremental value that is added to the identity value of the previous row that was loaded.

Add a comment
Know the answer?
Add Answer to:
Create a T-SQL statement that creates a table called Owner as part of a schema called...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. Write SQL CREATE Table statement to create the following table with Owner ID as a...

    1. Write SQL CREATE Table statement to create the following table with Owner ID as a surrogate key. Owner ID is a surrogate key (starts at 1 and increments by 1) hint: IDENTITY (1, 1) is syntax for surrogate key. PET_OWNER (OwnerID, OwnerLastName, OwnerFirstName, OwnerPhone, OwnerEmail) You can try inserting some data into your tables too! 2. Write SQL CREATE Table statement to create the following table with Pet ID as a surrogate key. Pet ID is a surrogate key...

  • Write SQL to create a table called City in your account. The schema of the table...

    Write SQL to create a table called City in your account. The schema of the table is listed below. You must define the data types and not null constraint (if needed) of every column and all the primary key and foreign key constraints for the table. No screenshot needed for this question. City (Name, Country, Population, Capital). Name: the name of the city. Text string with maximum 50 characters. Must not be null. Country: the name of the country where...

  • write an SQL statement to list all the people in the Owner table, along with their...

    write an SQL statement to list all the people in the Owner table, along with their pets' names if any. That is, for each pet an owner has, there will be a record containing the owner and the pet's name. For any owner contained in the Owner table, the output should always contain the owner's record even if no pets are associated with this owner. Hint: outer join/s may be needed. -- DROP TABLE PetAndOwner, Pet, PetType, Owner; CREATE TABLE...

  • Sample data for these tables are shown in Figures 3-26 and 3-27. For each SQL statement...

    Sample data for these tables are shown in Figures 3-26 and 3-27. For each SQL statement you write, show the results based on these data. If possible, run the statements you write for the questions that follow in an actual DBMS, as appropriate, to obtain results. Use data types that are consistent with the DBMS you are using. If you are not using an actual DBMS, consistently represent data types by using either the MySQL, Microsoft SQL Server, or Oracle...

  • Use an INSERT INTO statement with a subquery containing a SQL string function to create user...

    Use an INSERT INTO statement with a subquery containing a SQL string function to create user names for the volunteers based on their legal names and insert them into the table. +----------------------+ | Tables_in_volunteers | +----------------------+ | address              | | email                | | funds                | | hours                | | person               | | phone                | | users                | +----------------------+ users legal names are in the address table user table is : CREATE TABLE USERS(volunteer_id INT NOT NULL, username VARCHAR(50), PRIMARY KEY...

  • [IN SQL] New to working in SQL and I need to make a database called HAFH....

    [IN SQL] New to working in SQL and I need to make a database called HAFH. I am trying to create tables for the database with the information from the photo above but having issues. I am looking for the syntax that successfully creates these tables, and references each other. I know each table has to be made in a specific order, and that is what I am struggling with. INSPECTOR InsID InsName INSPECTING InsID (FK) BuildingID (FK) Date Last...

  • CREATE TABLE Gender ( gender CHAR(1), description VARCHAR(10), PRIMARY KEY (gender) ); CREATE TABLE People (...

    CREATE TABLE Gender ( gender CHAR(1), description VARCHAR(10), PRIMARY KEY (gender) ); CREATE TABLE People ( ID INT, name VARCHAR(50), gender CHAR(1), height FLOAT, PRIMARY KEY (ID), FOREIGN KEY (gender) REFERENCES Gender (gender) ); CREATE TABLE Sports ( ID INT, name VARCHAR(50), record FLOAT, PRIMARY KEY (ID), UNIQUE (name) ); CREATE TABLE Competitions ( ID INT, place VARCHAR(50), held DATE, PRIMARY KEY (ID) ); CREATE TABLE Results ( peopleID INT NOT NULL, competitionID INT NOT NULL, sportID INT NOT NULL,...

  • SQL CHECK CONSTRAINT AND TEST CASE... SQL Query Here are the tables: CREATE TABLE Movies(     movieID...

    SQL CHECK CONSTRAINT AND TEST CASE... SQL Query Here are the tables: CREATE TABLE Movies(     movieID INT,     name VARCHAR(30) NOT NULL,     year INT,     rating CHAR(1),     length INT,     totalEarned NUMERIC(7,2),     PRIMARY KEY(movieID),     UNIQUE(name, year) ); CREATE TABLE Showings(     theaterID INT,     showingDate DATE,     startTime TIME,     movieID INT,     priceCode CHAR(1),     PRIMARY KEY(theaterID, showingDate, startTime),     FOREIGN KEY(theaterID) REFERENCES Theaters,     FOREIGN KEY(movieID) REFERENCES Movies ); CREATE TABLE Tickets(     theaterID INT,     seatNum INT,     showingDate DATE,     startTime TIME,     customerID INT,     ticketPrice NUMERIC(4,2),     PRIMARY KEY(theaterID, seatNum, showingDate, startTime)...

  • -- Schema definition create table Customer (     cid   smallint not null,     name varchar(20),    ...

    -- Schema definition create table Customer (     cid   smallint not null,     name varchar(20),     city varchar(15),     constraint customer_pk         primary key (cid) ); create table Club (     club varchar(15) not null,     desc varchar(50),     constraint club_pk         primary key (club) ); create table Member (     club varchar(15) not null,     cid   smallint     not null,     constraint member_pk         primary key (club, cid),     constraint mem_fk_club         foreign key (club) references Club,     constraint mem_fk_cust...

  • Utilize the below normalized Entity-Relationship Diagram to create a Star Schema Diagram. To create a Star Schema from a...

    Utilize the below normalized Entity-Relationship Diagram to create a Star Schema Diagram. To create a Star Schema from a normalized data model, you will need to de-normalize the data model into fact and dimension tables. The diagram should contain all of the fact and dimension tables necessary to integrate the operational database into a data warehouse. Column Name Condensed Typ Nulla... Column Name Condensed Type Nulable ProducttD Column Name Condensed Type Nulable EmployelD int ShipVia nvarchan4) Column Nae Condansed Typ...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT