Welcome! Log In Create A New Profile

Advanced

Prac

Posted by Mac 
Announcements Last Post
Announcement myUnisa availability 21 to 24 March 2019 03/17/2019 02:24PM
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Re: Prac
October 13, 2006 02:07PM
Do I have to worry about stuff like field lengths, data types, etc. for the fields in the tables, or can I use my own?
avatar
Mac
Re: Prac
October 14, 2006 12:17PM
The structure for tables must be exactly as in the tut letter - don't tell me it isn't there?

Here is the structure:

CREATE TABLE `course` (
`cname` varchar(50) NOT NULL default '',
`cid` int(6) NOT NULL auto_increment,
PRIMARY KEY (`cid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `course_student`
--

CREATE TABLE `course_student` (
`sno` int(6) NOT NULL default '0',
`cid` int(6) NOT NULL default '0',
`year` int(4) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `student`
--

CREATE TABLE `student` (
`sno` int(6) NOT NULL auto_increment,
`sname` varchar(40) NOT NULL default '',
`init` varchar(5) NOT NULL default '',
`fname` varchar(40) NOT NULL default '',
`title` varchar(4) NOT NULL default '',
`msname` varchar(40) NOT NULL default '',
`dob` varchar(8) NOT NULL default '',
`sex` char(2) NOT NULL default '',
`lang` varchar(10) NOT NULL default '',
`idno` varchar(13) NOT NULL default '',
`telh` varchar(12) NOT NULL default '',
`telw` varchar(12) NOT NULL default '',
`cel` varchar(12) NOT NULL default '',
`fax` varchar(12) NOT NULL default '',
`email` varchar(40) NOT NULL default '',
`address` tinytext NOT NULL,
PRIMARY KEY (`sno`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Re: Prac
October 16, 2006 09:58AM
CREATE TABLE `course` ( 
   `cname` varchar(50) NOT NULL default '', 
   `cid` int(6) NOT NULL auto_increment, 
   PRIMARY KEY (`cid`) 
   ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

I cannot get the CHARSET option to work. In the end I used:
  CREATE TABLE course (
    cname varchar(50) NOT NULL default '',
    cid int(6) NOT NULL auto_increment,
    PRIMARY KEY  (cid)
  ) TYPE=MyISAM;

1. I ignored the DEFAULT CHARSET=latin1 for all tables created. Is this OK? If I have that statement in, I cannot get the CREATE TABLE to execute.
2. I changed ENGINE=MyISAM to TYPE=MyISAM. Is this OK?
avatar
Mac
Re: Prac
October 16, 2006 10:52AM
Yes - those parts tends to give problems if you use phpmyadmin.
Anonymous User
Where do we upload the prac to?
October 16, 2006 03:46PM
Where do we upload the practical?

- say there's a small error causing my application not to connect to your database (which i know from experience is 80% the case when running code on a new server) will I get 0?
avatar
Mac
Re: Prac
October 16, 2006 05:09PM
You just email it me zipped. Db connection errors I will solve at no cost to you - as long as I only have to do it in one single file smiling smiley
Re: Prac
October 18, 2006 01:48PM
Table: Student
--------------
`sex` char(2) NOT NULL default '',
--------------

- Is this used to store gender as Ma=Male and Fe=Female?

[edit]
Do I have to worry about Referential Integrity?
avatar
Mac
Re: Prac
October 20, 2006 08:01AM
Whatever you want to use - you don't have to use 2, you can just use m and f.
Re: Prac
October 25, 2006 11:23AM
Hi Mac,

Sent prac to @#$%&. How will I know if you received ?

Regards
Allen
avatar
Mac
Re: Prac
October 25, 2006 12:13PM
When you get your marks smiling smiley

No, let's do it this way - I'll create a new topic for and post there when I receive it.

Sometimes it struggles for a day to get past the Unisa firewall, so just give it a day or two.
Sorry, only registered users may post in this forum.

Click here to login