CREATE TABLE IF NOT EXISTS `User` ( `UserId` mediumint(11) NOT NULL AUTO_INCREMENT, `UserName` varchar(50) NOT NULL, `UserPassword` varchar(50) NOT NULL, `UserEmail` varchar(32) NOT NULL, `UserFirstName` varchar(35) NOT NULL, `UserLastName` varchar(35) NOT NULL, `UserToken` varchar(40) NOT NULL DEFAULT ‘0’, `UserRoleType` varchar(32) NOT NULL, `UserGroup` tinyint(1) NOT NULL DEFAULT ‘1’, `UserCreated` datetime DEFAULT ‘0000-00-00 00:00:00’, `UserLastLogin` datetime DEFAULT ‘0000-00-00 00:00:00’, `UserLastIP` varchar(12) DEFAULT ‘0’, `UserActive` enum(‘y’,’n’,’t’,’b’) NOT NULL DEFAULT ‘n’, PRIMARY KEY (`UserId`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `Image` ( `ImageId` mediumint(11) NOT NULL auto_increment, `ImageName` varchar(35) NOT NULL, `ImageFileSize` int(11) unsigned NOT NULL default ‘0’, `ImagePath` varchar(255) NOT NULL default ”, `ImageTag` varchar(255) NOT NULL default ”, `ImageTakenBy` varchar(35) NOT NULL, `ImageDateStamp` datetime DEFAULT ‘0000-00-00 00:00:00’, `ImageNote` varchar(100) NOT NULL, `ImageRes_X` int(5) NOT NULL default ‘0’, `ImageRes_Y` int(5) NOT NULL default ‘0’, `ImageStatus` char(1) NOT NULL default ‘n’, PRIMARY KEY (`ImageId`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `Instrument` ( `InstrumentId` mediumint(11) NOT NULL auto_increment, `InstrumentModel` varchar(50) NOT NULL, `InstrumentSoftware` varchar(50) NOT NULL, `InstrumentExifVersion` varchar(50) NOT NULL, `InstrumentShutterSpeed` varchar(50) NOT NULL, `InstrumentCompression` mediumint(10) NOT NULL, `InstrumentFlashMode` mediumint(32) NOT NULL, `InstrumentISO` varchar(50) NOT NULL, `InstrumentDateStamp` datetime DEFAULT ‘0000-00-00 00:00:00’, PRIMARY KEY (`InstrumentId`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

The provided code is an SQL script that creates three tables: User, Image, and Instrument. These tables are used to store information related to users, images, and instruments.

The User table has the following columns:

– UserId: a unique identifier for each user. It is of type mediumint(11) and has the AUTO_INCREMENT attribute, which means that each time a new row is inserted, the value of this column will be automatically incremented.

– UserName: a varchar(50) column that stores the username of the user. It cannot be NULL.

– UserPassword: a varchar(50) column that stores the password of the user. It cannot be NULL.

– UserEmail: a varchar(32) column that stores the email of the user. It cannot be NULL.

– UserFirstName and UserLastName: varchar(35) columns that store the first name and last name of the user, respectively. They cannot be NULL.

– UserToken: a varchar(40) column used for token authentication. It has a default value of ‘0’.

– UserRoleType: a varchar(32) column that stores the role type of the user.

– UserGroup: a tinyint(1) column that stores the group to which the user belongs. It has a default value of ‘1’.

– UserCreated and UserLastLogin: datetime columns that store the date and time the user was created and last logged in, respectively. They have default values of ‘0000-00-00 00:00:00’.

– UserLastIP: a varchar(12) column that stores the IP address of the user’s last login. It has a default value of ‘0’ (presumably for cases when the IP address is not available).

– UserActive: an enum(‘y’,’n’,’t’,’b’) column that stores the status of the user. It has a default value of ‘n’.

The Image table has the following columns:

– ImageId: a unique identifier for each image. It is of type mediumint(11) and has the AUTO_INCREMENT attribute.

– ImageName: a varchar(35) column that stores the name of the image. It cannot be NULL.

– ImageFileSize: an unsigned int(11) column that stores the file size of the image.

– ImagePath: a varchar(255) column that stores the path or location of the image.

– ImageTag: a varchar(255) column that stores the tag or description of the image.

– ImageTakenBy: a varchar(35) column that stores the name of the person who took the image. It cannot be NULL.

– ImageDateStamp: a datetime column that stores the date and time the image was taken. It has a default value of ‘0000-00-00 00:00:00’.

– ImageNote: a varchar(100) column that stores any additional notes or comments about the image. It cannot be NULL.

– ImageRes_X and ImageRes_Y: int(5) columns that store the resolution of the image in the X and Y dimensions, respectively. They cannot be NULL and have default values of ‘0’.

– ImageStatus: a char(1) column that stores the status of the image. It has a default value of ‘n’.

The Instrument table has the following columns:

– InstrumentId: a unique identifier for each instrument. It is of type mediumint(11) and has the AUTO_INCREMENT attribute.

– InstrumentModel, InstrumentSoftware, InstrumentExifVersion, InstrumentShutterSpeed, InstrumentISO: varchar(50) columns that store information about the instrument model, software, Exif (Exchangeable Image File Format) version, shutter speed, and ISO (International Organization for Standardization) settings, respectively. They cannot be NULL.

– InstrumentCompression and InstrumentFlashMode: mediumint(10) and mediumint(32) columns that store information about the compression and flash mode settings of the instrument, respectively.

– InstrumentDateStamp: a datetime column that stores the date and time information of the instrument. It has a default value of ‘0000-00-00 00:00:00’.

Each table has a primary key, which uniquely identifies each row in the table. The tables are using the MyISAM storage engine and the UTF-8 character set.

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer