Helo,
I have problem in finding right tutorial how to create multi key in DB.
I have 4 tables. in each I have
TIME datatime
Nr int
I want them as a MUL key, could You help me in creating the right code to create such a tables.The code has a bug in sql syntax, can You see -
CREATE TABLE table1 (
-
value int(11) NOT NULL default '0',
-
time datetime NOT NULL default '0000-00-00 00:00:00',
-
nr int(10) unsigned NOT NULL default '0',
-
KEY `time` (`time`),
-
KEY `node` (`node_nr`)
-
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
-
I am not sure about apostrophs..
I would be very grateful for help,Thanks!
5 13321
sorry, here is the code I have: -
CREATE TABLE table1 (
-
value int(11) NOT NULL DEFAULT '0',
-
time datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
-
nr int(10) UNSIGNED NOT NULL DEFAULT '0',
-
KEY `time` (`time`),
-
KEY `node` (`nr`)
-
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
-
it does not work ...mayby any idea..thanks
sorry, here is the code I have: -
CREATE TABLE table1 (
-
value int(11) NOT NULL DEFAULT '0',
-
time datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
-
nr int(10) UNSIGNED NOT NULL DEFAULT '0',
-
KEY `time` (`time`),
-
KEY `node` (`nr`)
-
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
-
it does not work ...mayby any idea..thanks
Please POST your error here for reference?
Hi,
I have deleted the apostrophs from code, but the error still is. -
mysql> CREATE TABLE smoke (
-
-> smoke varchar(5) NOT NULL default '0',
-
-> time datetime NOT NULL default '0000-00-00 00:00:00',
-
-> node_nr int(10) unsigned NOT NULL default '0',
-
-> KEY time (time),
-
-> KEY node (node_nr);
-
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 6
What do You think is wrong in the code?thanks.
I used myadmin:) and it works..less difficult...
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Andrew Kuebler |
last post by:
When I type:
Show keys from ;
I do not see foreign keys listed there and I cannot seem to find any
command that will list foreign keys. Can anyone help?
Also, I notice Innodb tables only store one file unlike MyISAM which
stores 3. Are Innodb tables any slower than MyISAM since they store all
data in a single file? I am looking to use Innodb for an application
|
by: Joshua Spoerri |
last post by:
Which version is targetted for optimization of OR searching on two keys,
that is, "select * from sometable where f1 = 123 or f2 = 123",
as described in http://www.mysql.com/doc/en/Searching_on_two_keys.html
?
Thanks
--
MySQL General Mailing List
|
by: Randell D. |
last post by:
Can anyone tell me what the difference is between keys and indexes?
Much appreciated,
randelld
|
by: Morten Gulbrandsen |
last post by:
Hello,
starting from some software database spesification,
defined in some Enhanced entity relationship diagram,
resulting in all kinds of
relationships,
1:1
1:Many
Many:1
|
by: Jeff Silverman |
last post by:
I am working on my first database and I think I want to build a table with
a foreign key in it. The O'Reilly book on MySQL says that MySQL does not
support foreign keys, but it still talks about them in the section on
database design.
So, if if I want to use a foreign key, how do I do it?
Many thanks,
| |
by: DFS |
last post by:
It installed as a service, and seemed to start just fine, but on the
'databases' tab of the WinMySQLAdmin ver 1.4, I can't create databases. It
shows 'test' but no tables. Right clicking gives me a menu with 4 flush
choices
Contents of C:\Windows\my.ini follows:
#This File was made using the WinMySQLAdmin 1.4 Tool
#8/5/2004 12:48:19 PM
|
by: steve |
last post by:
Hi, I want to share my experience with you. If you have large tables,
and you are doing joins, be extra careful that the keys in the joins
have exactly the same size (and type). Don’t mix mediumint and int
for example.
There is a huge performance hit if your join keys are not the same
size. This IS documented on mysql.com, but not everyone reads
everything :D
Just beware!
|
by: JirkaJ |
last post by:
Hello,
is it possible(and how?) to make a new database in a specified folder -
i.e. /home/me/mysqldb? or how may i install mysql on debian to use this
folder for data files?
thanks
j.
|
by: stevenkwlee |
last post by:
Hi
I'm new to Access (2003) and i've just been given the horrible horrible task of trying to add extra functionality to an exisiting access database. I'm usually alright in the database front, since i've worked with mysql etc. But this relationship thing is really bugging the heck out of me.
First of all there's a few tables which contains primary keys from different tables (they are highlighted in bold) and then a relationship link to it...
|
by: lionelm2007 |
last post by:
In mysql, I need to create a table to store the many-to-many relationship of the other two tables.
Here is the problem:
the first table has three fields that act as the primary key of the table
the second table has only one field for the primary key
i know the association table will have the primary keys of both tables as its own primary key but it seems that I can't do that. It appears that the three fields primary key in the first...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |