Hi All
I have 2 tables (as shown below), if i add a row to the FILES TABLE then the myid value is added to mydata list in the PLAYLISTS TABLE, based on the genre matching the myname values.
Hope this makes sense.
So my question is how do i add myid to mydata when new files are added to the FILES TABLE.
Thanks FILES TABLE
filepath.........artist..............album.....gen re.......myid
c:/files..........u2..................war........Rock ........1234
c:/files..........u2..................war........Rock ........1235
c:/files..........u2..................war........Rock ........1236
c:/files..........madonna........hits........Rock.... ....1237 PLAYLISTS TABLE
myname.......user........mydata
Rock............admin.....1234,1235,1236
Pop..............admin.....1237
2 1641
The mydata column in a no-no (non-atomic data is impossible to normalize).
Just my two cents worth...
Heya. MrCrunchy. Welcome to TSDN!
Try this structure: -
CREATE TABLE
-
`files`
-
(
-
`fileid`
-
BIGINT(20)
-
UNSIGNED
-
NOT NULL
-
AUTO_INCREMENT,
-
`albumid`
-
BIGINT(20)
-
UNSIGNED
-
NOT NULL,
-
`genreid`
-
BIGINT(20)
-
UNSIGNED
-
NOT NULL,
-
`path`
-
VARCHAR(100)
-
NAT NULL,
-
-
PRIMARY KEY
-
(`fileid`),
-
KEY
-
`artist`
-
(`artistid`),
-
KEY
-
`album`
-
(`albumid`),
-
KEY
-
`genre`
-
(`genreid`)
-
);
-
-
CREATE TABLE
-
`artists`
-
(
-
`artistid`
-
BIGINT(20)
-
UNSIGNED
-
NOT NULL
-
AUTO_INCREMENT,
-
`name`
-
VARCHAR(50)
-
NOT NULL,
-
-
PRIMARY KEY
-
(`artistid`)
-
);
-
-
CREATE TABLE
-
`albums`
-
(
-
`albumid`
-
BIGINT(20)
-
UNSIGNED
-
NOT NULL
-
AUTO_INCREMENT,
-
`name`
-
VARCHAR(50)
-
NOT NULL,
-
`releaseYear`
-
SMALLINT(4)
-
UNSIGNED
-
NOT NULL,
-
-
PRIMARY KEY
-
(`albumid`),
-
KEY
-
`releaseYear`
-
(`releaseYear`)
-
);
-
-
CREATE TABLE
-
`map_album_artist`
-
(
-
`albumid`
-
BIGINT(20)
-
UNSIGNED
-
NOT NULL,
-
`artistid`
-
BIGINT(20)
-
UNSIGNED
-
NOT NULL,
-
-
PRIMARY KEY
-
(
-
`albumid`,
-
`artistid`
-
),
-
KEY
-
`artist`
-
(`artistid`)
-
);
-
-
CREATE TABLE
-
`genres`
-
(
-
`genreid`
-
BIGINT(20)
-
UNSIGNED
-
NOT NULL,
-
`name`
-
VARCHAR(50),
-
-
PRIMARY KEY
-
(`genreid`),
-
UNIQUE KEY
-
`name`
-
(`name`)
-
);
-
-
CREATE TABLE
-
`users`
-
(
-
`userid`
-
BIGINT(20)
-
UNSIGNED
-
NOT NULL,
-
`username`
-
VARCHAR(50)
-
NOT NULL,
-
-- You probably have some other columns that go in this table.
-
-
PRIMARY KEY
-
(`userid`),
-
UNIQUE KEY
-
`username`
-
(`username`)
-
);
-
-
CREATE TABLE
-
`playlists`
-
(
-
`playlistid`
-
BIGINT(20)
-
UNSIGNED
-
NOT NULL,
-
`name`
-
VARCHAR(50)
-
NOT NULL,
-
-
PRIMARY KEY
-
(`playlistid`),
-
KEY
-
`name`
-
(`name`)
-
);
-
-
CREATE TABLE
-
`map_playlist_file`
-
(
-
`playlistid`
-
BIGINT(20)
-
UNSIGNED
-
NOT NULL,
-
`fileid`
-
BIGINT(20)
-
UNSIGNED
-
NOT NULL,
-
-
PRIMARY KEY
-
(`playlistid`),
-
KEY
-
`file`
-
(`fileid`)
-
);
-
-
CREATE TABLE
-
`map_playlist_user`
-
(
-
`playlistid`
-
BIGINT(20)
-
UNSIGNED
-
NOT NULL,
-
`userid`
-
BIGINT(20)
-
UNSIGNED
-
NOT NULL,
-
-
PRIMARY KEY
-
(
-
`playlistid`,
-
`userid`
-
),
-
KEY
-
`user`
-
(`userid`)
-
);
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: shank |
last post by:
I have a recordset that contains multiple records of product a user is
purchasing. For clarity, I converted the recordset fields to variables. I
need to take that entire recordset and insert it...
|
by: PT |
last post by:
I got a problem. And thats.....
First of all, I got these three tables.
------------------- ------------------ ----------------------
tblPerson tblPersonSoftware ...
|
by: Bill |
last post by:
I'm having what seems to me to be an odd problem. Perhaps there is some
explanation, but don't know at this point. Basically I have a form that
tracks memberships and donations. The main form...
|
by: Sami |
last post by:
Please bear with me, and if you answer this question, please do it
step by step. I am new at Access, not at all sophisticated. I am
using Office XP. This will need to be read in Access for...
|
by: Bri |
last post by:
Greetings,
I'm having a very strange problem in an AC97 MDB with ODBC Linked tables
to SQL Server 7. The table has an Identity field and a Timestamp field.
The problem is that when a new record...
|
by: elfyn |
last post by:
I'm currently building a DB that you will keep track of vehicles,
services to the vehicles and parts used for the servicing of the
vehicles.
I've created a table for Customers, Vehicles and...
|
by: Carl |
last post by:
Hi,
I hope someone can share some of their professional advice and help me out
with my embarissing problem concerning an Access INSERT query. I have never
attempted to create a table with...
|
by: David Bear |
last post by:
I have a dictionary that contains a row of data intended for a data base.
The dictionary keys are the field names. The values are the values to be
inserted.
I am looking for a good pythonic...
|
by: shookim |
last post by:
I don't care how one suggests I do it, but I've been searching for days
on how to implement this concept. I'm trying to use some kind of grid
control (doesn't have to be a grid control, whatever...
|
by: SaltyBoat |
last post by:
Needing to import and parse data from a large PDF file into an Access
2002 table: I start by converted the PDF file to a html file. Then
I read this html text file, line by line, into a table...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
| |