Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: PostgreSQL help

  1. #1
    Regular Coder MrEnder's Avatar
    Join Date
    Jul 2008
    Location
    Canada Ontario
    Posts
    258
    Thanks
    18
    Thanked 4 Times in 4 Posts

    PostgreSQL help

    apologies for the not very descriptive name... was not sure how to name this. I have never delt with Databases before of any kind and suddenly my college expects me to know how to do it off one lecture that happened 2 weeks ago. Normally they give a tutorial on how to do it online... for some reason this assignment has no help =[ so I don't even know where to start...

    I got the database on prostgresql made the assignment did explain how to do that. But now I'm supposed to make a table with 5 columns... whats the command to make a table and the command to make a colum? Do I do this in PHP? Do I do it some other way? How I'm completely at a loss... I've been asking everyone in my class if they understand it can't find a soul who understands it. So I'd really appreciate some help. I will post the assignment. I don't want you to do it for me but any information that might help me complete it would be amazing. Thanks.

    Code:
    Provide the SQL statements in a text file named lab7_auto_info.sql  that would fulfill the following requirements.  Make sure your statements conform to preferred SQL standards (i.e. do not use the * wild card in your select statements, and type columns names in your insert statements).  This file will be stored in a sql folder on the opentech server (in your working directory), be sure to run the script against your db on the server (as you are to display the contents in a table on a PHP page.  See requirements on the course web server.
    
    
    N.B. Where data types for fields (or columns) in the database are not specified, select one that makes sense.  Be able to justify your choices (there will be marks lost for inappropriate selections)
    
       
    1.	Produce the statement that will create a table named “auto_info” that has the following fields (Be sure to choose a column as an appropriate primary key):
    a.	A column named “id_num” that will store a number as an identification for the vehicle
    b.	a column named “make” that can hold strings up to 15 characters that will contain the automobiles make
    c.	a column named “model” that can hold strings up to 20 characters
    d.	a column named “year” that will hold the car’s year of manufacture (choose an appropriate data type)
    e.	a column named “owner” that will store the car owner’s name 
    f.	a column named “msrp” that will store the car’s manufacturer’s suggested retail price
    g.	a column named “purchase_date” that will store the automobile’s date of purchase
    
    2.	Produce (5) statements that will insert five records of your favourite cars into the “auto_info” table 
    
    3.	Produce a select statement that shows all five (5) vehicles make, model, year and msrp, order by increasing year.
    
    
    4.	Produce a SQL statement that updates the record that has your favourite car so that your name is stored as the owner.
    
    
    5.	Produce a SQL statement that deletes your least favourite of the 5 cars in the database.
    Thanks a tun
    Shelby
    Continually Learning

  • #2
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts

  • Users who have thanked MattF for this post:

    MrEnder (03-22-2010)

  • #3
    Regular Coder MrEnder's Avatar
    Join Date
    Jul 2008
    Location
    Canada Ontario
    Posts
    258
    Thanks
    18
    Thanked 4 Times in 4 Posts
    thanks ^.^
    Continually Learning


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •