Question

(3.5 Marks) Create the table CAR and create the fields with primary key Field Name Data type Size Constraint A2.1 Name Model

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution A2.1:

CREATE TABLE CAR(

Name varchar(25) NOT NULL,

Model integer PRIMARY KEY,

Price Float(10,2),

MFD Date

);

Solution A2.2:

SELECT Name, Model, Price, MFD, LOWER(Name) AS Newname

FROM CAR;

Solution A2.3:

SELECT Name, ((Price*15)/100) AS Offer

FROM CAR;

Add a comment
Know the answer?
Add Answer to:
(3.5 Marks) Create the table CAR and create the fields with primary key Field Name Data...
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
  • 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,...

  • CREATE TABLE actor( id INTEGER NOT NULL, name VARCHAR(100), PRIMARY KEY (id) ); SELECT name FROM...

    CREATE TABLE actor( id INTEGER NOT NULL, name VARCHAR(100), PRIMARY KEY (id) ); SELECT name FROM actor WHERE name LIKE 'M%'; Q. How to run explain plan on the above query and display its output?

  • Create a table tHW2_1_xxxx with the following fields and their data types (id:int, auto increment, Name:...

    Create a table tHW2_1_xxxx with the following fields and their data types (id:int, auto increment, Name: varchar(10), birthday: date, annual_salary: float, bno: varchar(8)), where id is primary key and bno is a foreign key to the branchno column of Branch table in the dreamhome database. All fields cannot be null. then insert five records into your tHW2_1_xxxx table. All the name, birthday, should be different.

  • Emirates College of Technology Lab Exercise #1 AConsider the following answer the questions below 2 table named "Car" and then use database management system to 116 marks Car umber Bra...

    Emirates College of Technology Lab Exercise #1 AConsider the following answer the questions below 2 table named "Car" and then use database management system to 116 marks Car umber BrandModel Opel Opel 2348 2546 233 Volkswagen VSE 648 BFK 297 SB A5526 1000 1.8 29000 zafira Golf 1. Write an SQl, statement to create the car table shown above. Set CNumber as primary key (4 marks) 2. 3 marks) Write an SQL statement to insert all the records. Write an...

  • create table salary (empid int primary key references emp (empid),                      paygrade varchar(2),       &nb

    create table salary (empid int primary key references emp (empid),                      paygrade varchar(2),                      amount decimal (10,2),                      lupdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP, foreign key (empid) references emp (empid)); Use the Salary table above to answer the following question. Add a column to the salary table named position with each person's position as "staff", except for Walton, Shah, Harper who are "manager". ALTER TABLE salary ADD position varchar(32); how do we make the exception for Walton, Shah, Harper to be managers...is it the DEFAULT...

  • Lesson 10Create the DEPARTMENT tables based on the following: Column Name   ID      Name Data Type     Number...

    Lesson 10Create the DEPARTMENT tables based on the following: Column Name   ID      Name Data Type     Number Varchar2 Length        7      25 Populate the DEPARTMENT table with data from the DEPT table. Include only columns that you need. Create the EMPLOYEE table based on the following table chart: Column Name    ID      LAST_NAME     FIRST_NAME     DEPT_ID Data Type      Number Varchar2      Varchar2       Number Length         7       25            25             7 Modify the EMPLOYEE table to allow for longer employee last names. Confirm your modification. Confirm that both the...

  • -- 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...

  • create table candidate ( cand_id   varchar(12) primary key,   -- cand_id name       varchar(40)           --...

    create table candidate ( cand_id   varchar(12) primary key,   -- cand_id name       varchar(40)           -- cand_nm ); create table contributor ( contbr_id   integer primary key, name       varchar(40),           -- contbr_nm city     varchar(40),           -- contbr_city state       varchar(40),           -- contbr_st zip       varchar(20),           -- contbr_zip employer   varchar(60),           -- contbr_employer occupation   varchar(40)           -- contbr_occupation ); create table contribution ( contb_id   integer primary key, cand_id   varchar(12),           --...

  • CREATE TABLE customer (    id INTEGER PRIMARY KEY,    customer_name TEXT,    contact_number TEXT );...

    CREATE TABLE customer (    id INTEGER PRIMARY KEY,    customer_name TEXT,    contact_number TEXT ); CREATE TABLE supplier (    id INTEGER PRIMARY KEY,    supplier_name TEXT UNIQUE,    contact_number TEXT ); CREATE TABLE product (    id INTEGER PRIMARY KEY,    supplier_id INTEGER REFERENCES supplier(id),    product_name TEXT,    product_price INTEGER,    UNIQUE(supplier_id, product_name) ); CREATE TABLE purchase (    id INTEGER PRIMARY KEY,    customer_id INTEGER REFERENCES customer(id),    purchase_date REAL,    store_id INTEGER REFERENCES store(id) );...

  • Please convert figure 9.9 in p305 into relational schemas. In the table, the primary key and...

    Please convert figure 9.9 in p305 into relational schemas. In the table, the primary key and foreign keys (arrows) must be identified. Engin size CAR Vin Price VEHICLE d TRUCK Tonnage Model N Date SUV No seats SALE SALESPERSON CUSTOMER Address City Street Sid Name Ssn State Name Figure 9.9 EER diagram for a car dealer

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