Search Results

Search found 187 results on 8 pages for 'latin1'.

Page 4/8 | < Previous Page | 1 2 3 4 5 6 7 8  | Next Page >

  • MySQL Paritioning performance

    - by Imran Pathan
    Measured performance on key partitioned tables and normal tables separately. But we couldn't find any performance improvement with partitioning. Queries are pruned. Using MySQL 5.1.47 on RHEL 4. Table details: UserUsage - Will have entries for user mobile number and data usage for each date. Mobile number and Date as PRI KEY. UserProfile - Queries prev table and stores summary for each mobile number. Mobile number PRI KEY. CREATE TABLE `UserUsage` ( `Msisdn` decimal(20,0) NOT NULL, `Date` date NOT NULL, . . PRIMARY KEY USING BTREE (`Msisdn`,`Date`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY KEY(Msisdn) PARTITIONS 50; CREATE TABLE `UserProfile` ( `Msisdn` decimal(20,0) NOT NULL, . . PRIMARY KEY (`Msisdn`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY KEY(Msisdn) PARTITIONS 50; Second table is updated by query select and order by date in first table in a perl program, query is select * from UserUsage where Msisdn=number order by Date desc limit 7 [Process data in perl] update UserProfile values(....) where Msisdn=number explain partition for select, shows row being scanned in a particular partition only. Is something wrong with partition design or queries as partitioning is taking almost same or more time compared to normal tables?

    Read the article

  • How to display multiple categories and products underneath each category?

    - by shin
    Generally there is a category menu and each link to a category page where shows all the items under that category. Now I need to show all the categories and products underneath with PHP/MySQL in the same page. So it will be like this. Category 1 description of category 1 item 1 item 2 .. Category 2 description of category 2 item 5 item 6 .. Category 3 description of category 3 item 8 item 9 ... ... I have category and product table in my database. But I am not sure how to proceed. CREATE TABLE IF NOT EXISTS `omc_product` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `shortdesc` varchar(255) NOT NULL, `longdesc` text NOT NULL, `thumbnail` varchar(255) NOT NULL, `image` varchar(255) NOT NULL, `product_order` int(11) DEFAULT NULL, `class` varchar(255) DEFAULT NULL, `grouping` varchar(16) DEFAULT NULL, `status` enum('active','inactive') NOT NULL, `category_id` int(11) NOT NULL, `featured` enum('none','front','webshop') NOT NULL, `other_feature` enum('none','most sold','new product') NOT NULL, `price` float(7,2) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; CREATE TABLE IF NOT EXISTS `omc_category` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `shortdesc` varchar(255) NOT NULL, `longdesc` text NOT NULL, `status` enum('active','inactive') NOT NULL, `parentid` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; I will appreciate your help. Thanks in advance.

    Read the article

  • symfony + doctrine + inheritance, how to make them work?

    - by imac
    I am beginning to work with Symfony, I've found some documentation about inheritance. But also found this discouraging article, which make me doubt if Doctrine handles inheritance any good at all... Has anyone find a smart solution for inheritance in Symfony+Doctrine? As an example, I have already structured the database something like this: CREATE TABLE `poster` ( `poster_id` int(11) NOT NULL AUTO_INCREMENT, `user_name` varchar(50) NOT NULL, PRIMARY KEY (`poster_id`), UNIQUE KEY `id` (`poster_id`), ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; CREATE TABLE `user` ( `user_id` int(11) NOT NULL, `real_name` varchar(50) DEFAULT NULL, PRIMARY KEY (`user_id`), UNIQUE KEY `user_id` (`user_id`), CONSTRAINT `user_fk` FOREIGN KEY (`user_id`) REFERENCES `poster` (`poster_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; From that, Doctrine generated this "schema.yml": Poster: connection: doctrine tableName: poster columns: poster_id: type: integer(4) fixed: false unsigned: false primary: true autoincrement: true user_name: type: string(50) fixed: false unsigned: false primary: false notnull: true autoincrement: false relations: Post: local: poster_id foreign: poster_id type: many User: local: poster_id foreign: user_id type: many Version: local: poster_id foreign: poster_id type: many User: connection: doctrine tableName: user columns: user_id: type: integer(4) fixed: false unsigned: false primary: true autoincrement: false real_name: type: string(50) fixed: false unsigned: false primary: false notnull: false autoincrement: false relations: Poster: local: user_id foreign: poster_id type: one User creation for this structure with Doctrine auto-generated forms does not work. Any clue will be appreciated.

    Read the article

  • Mysql - Help me alter this query to apply AND logic instead of OR in searching?

    - by sandeepan-nath
    First execute these tables and data dumps :- CREATE TABLE IF NOT EXISTS `Tags` ( `id_tag` int(10) unsigned NOT NULL auto_increment, `tag` varchar(255) default NULL, PRIMARY KEY (`id_tag`), UNIQUE KEY `tag` (`tag`), KEY `id_tag` (`id_tag`), KEY `tag_2` (`tag`), KEY `tag_3` (`tag`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ; INSERT INTO `Tags` (`id_tag`, `tag`) VALUES (1, 'key1'), (2, 'key2'); CREATE TABLE IF NOT EXISTS `Tutors_Tag_Relations` ( `id_tag` int(10) unsigned NOT NULL default '0', `id_tutor` int(10) default NULL, KEY `Tutors_Tag_Relations` (`id_tag`), KEY `id_tutor` (`id_tutor`), KEY `id_tag` (`id_tag`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `Tutors_Tag_Relations` (`id_tag`, `id_tutor`) VALUES (1, 1), (2, 1); The following query finds all the tutors from Tutors_Tag_Relations table which have reference to at least one of the terms "key1" or "key2". SELECT td . * FROM Tutors_Tag_Relations AS td INNER JOIN Tags AS t ON t.id_tag = td.id_tag WHERE t.tag LIKE "%key1%" OR t.tag LIKE "%key2%" Group by td.id_tutor LIMIT 10 Please help me modify this query so that it returns all the tutors from Tutors_Tag_Relations table which have reference to both the terms "key1" and "key2" (AND logic instead of OR logic). Please suggest an optimized query considering huge number of data records (the query should NOT individually fetch two sets of tutors matching each keyword and then find the intersection).

    Read the article

  • Custom Drupal Module not creating any tables

    - by Anthony
    Anything specific I need in the module file? Install File function module_install() { //lets create the school database $create_table_sql = "CREATE TABLE IF NOT EXISTS `table1` ( id int(11) NOT NULL, principal_name varchar(300) NOT NULL, school_name varchar(300) NOT NULL, address1 varchar(300) NOT NULL, address2 varchar(300) NOT NULL, city varchar(300) NOT NULL, computer_serial_no varchar(300) NOT NULL, state varchar(200) NOT NULL, uid int(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1"; db_query($create_table_sql); //lets create the student database $create_table_sql = "CREATE TABLE IF NOT EXISTS table2 ( id int(11) NOT NULL, principal_name varchar(300) NOT NULL, school_name varchar(300) NOT NULL, address1 varchar(300) NOT NULL, address2 varchar(300) NOT NULL, city varchar(300) NOT NULL, computer_serial_no varchar(300) NOT NULL, state varchar(200) NOT NULL, uid int(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1"; db_query($create_table_sql); } /** * _UNINSTALL hook * * This function is run to uninstall the module. * */ function module_uninstall() { // Delete the DB db_query("drop table table1"); db_query("drop table table2"); } Info File Just in Case ; $Id$ name = My Module description = This module deals with blah blah package = Somepackage core = 6.x version = "6.x-1.0" core = "6.x"

    Read the article

  • UTF-8 support in java application

    - by jacekn
    I'm having trouble with UTF-8. common.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> typical.jsp <%@ include file="common.jsp" %> Page Head <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> Form <form id="screenObject" accept-charset="UTF-8" action="/SiteAdmin/articleHeaderEdit?articleId=15" method="post"> I enter non latin1 characters into a text field and click Save. Validator complains about another field and stops the submission. This never gets to the database, so database ability to handle UTF-8 is not in this picture. The page redisplays with appropriate error but the text that had been entered is all messed up. All non latin1 characters are converted to some gibberish. I'm using Spring 3 MVC, in case that matters... Attempts Adding this to my view resolver didn't help: <property name="contentType" value="text/html;charset=UTF-8" />

    Read the article

  • Mysql charset problem

    - by Newtonx
    I'm trying to import some data from one server to another. But when I do it, I'm having problems with charset. Words like Goiânia became Goiâni and conceição became conceição My Application was set to use latin1 charset Server 1 : MySQL Charset : UTF-8 Unicode (utf8) table collation : latin1_swedish_ci Server 2 : MySQL Charset: UTF-8 Unicode (utf8) table collation : latin1_swedish_ci Command I used to export data from server 1 mysqldump -u root -p --default-character-set=iso-8859-1 database_name db.sql Command used to restore to server 2 mysql -u root -p database_name < db.sql

    Read the article

  • problem in displays data in one page

    - by user318068
    hi ,,,,, I have a problem in the following code ... The following code works as follows displays the invites for each member so that if he had five invite from supposed to be displayed all on one page But before you code that does not function Proper image is the only display one invite on the page and until the approval or rejection of the invitation displays the invite the other .... But this is not my want to offer all on one page I wish I could solve the problem and I can view all calls in one page I think that the problem is in the order code I think that the problem is in the order code my code : <?php session_start(); if (!isset($_SESSION['user_id'])) { header("Location: login.php"); } $id=$_SESSION['user_id']; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <center> <?php include("connect.php"); $sql =mysql_query("select * from ninvite where recieverMemberID ='$id' and viwed= '0'"); $num =mysql_num_rows($sql); echo $num ; if ($num>0) { while($row=mysql_fetch_array($sql)) { $sender=$row['SenderMemberID']; $room=$row['RoomID']; $sql =mysql_query("select MemberName from members where MemberID ='$sender' "); $sql1 =mysql_query("select RoomName from rooms where RoomID ='$room' "); while($row=mysql_fetch_array($sql)) {$mem =$row['MemberName']; } while($rows=mysql_fetch_array($sql1)) { $Ro =$rows['RoomName']; ?> <form action="join.php" method="post"> <label> </label> <br/> <label> <?php echo " you have invite from $mem to join $Ro"; ?> </label> <br/><br/> <label>accept</label> <input name="radio1" type="radio" value="accpet" /> <label>reject</label> <input name="radio1" type="radio" value="Reject" /><br/> <input type="submit" name="submit" value="done" /> </form> <?php } } } ?> </center> </body> </html> thanks alot. my SQl -- phpMyAdmin SQL Dump -- version 3.2.4 -- http://www.phpmyadmin.net -- Host: localhost -- Generation Time: May 07, 2010 at 12:50 ? -- Server version: 5.1.41 -- PHP Version: 5.3.1 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT /; /!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS /; /!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION /; /!40101 SET NAMES utf8 */; -- -- Database: tr -- -- Table structure for table joinroom CREATE TABLE IF NOT EXISTS joinroom ( MemberID int(10) NOT NULL, RoomID int(10) NOT NULL, PRIMARY KEY (MemberID,RoomID) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table joinroom INSERT INTO joinroom (MemberID, RoomID) VALUES (28, 1); -- -- Table structure for table members CREATE TABLE IF NOT EXISTS members ( MemberID int(10) unsigned NOT NULL AUTO_INCREMENT, MemberName varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, MemberPass varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, MemberEmail varchar(30) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, MemberLocation text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, MemberImg text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (MemberID) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=34 ; -- -- Dumping data for table members INSERT INTO members (MemberID, MemberName, MemberPass, MemberEmail, MemberLocation, MemberImg) VALUES (28, 'marwa', '1234', '[email protected]', 'mmmmmm', 'dddddddddd'), (29, 'nora', '1234', '[email protected]', 'fffffffffffgg', 'gggggggggggggg'), (30, 'soso', '1234', '[email protected]', 'ffffffff', 'kkkkkkkkkkkkkkkkkk'), (31, 'gege', '1234', '[email protected]', 'kkkkkkkkkkkkkkkk', 'uuuuuuuuuuuuuuuuu'), (32, 'nono', '1234', '[email protected]', 'ggggggggggggaaaaa', 'aaaaaaaaaaaaaaa'), (33, 'nda', '1234', '[email protected]', 'kkkkkkkkkkkkkkkk', 'ooooooooooooooo'); -- -- Table structure for table ninvite CREATE TABLE IF NOT EXISTS ninvite ( SenderMemberID int(11) NOT NULL AUTO_INCREMENT, recieverMemberID varchar(30) NOT NULL, RoomID int(11) NOT NULL, viwed int(11) NOT NULL, PRIMARY KEY (SenderMemberID,recieverMemberID,RoomID) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=33 ; -- -- Dumping data for table ninvite INSERT INTO ninvite (SenderMemberID, recieverMemberID, RoomID, viwed) VALUES (28, '33', 1, 0), (28, '32', 1, 0), (28, '31', 1, 0); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT /; /!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS /; /!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

    Read the article

  • What is wrong with my PHP/MySQL code?

    - by James
    I am building a navigation menu which lists all my categories and subcategories. The problem is it returns only one of these and not all. I have the categories echoed inside the while loop so I'm not sure why it's only showing one result and not all: <?php $query = mysql_query("SELECT * FROM categories_parent"); while ($row = mysql_fetch_assoc($query)) { $id = $row['id']; $name = $row['name']; $slug = $row['slug']; $childStatus = $row['child_status']; // if has child categories if ($childStatus == "1") { echo "<li class='dir'><a href='category.php?slug=$slug'>$name</a>"; echo "<ul id='dropdown'>"; $query = mysql_query("SELECT * FROM categories_child WHERE parent=$id"); while ($row = mysql_fetch_assoc($query)) { $id = $row['id']; $name = $row['name']; $slug = $row['slug']; echo "<li><a href='category.php?slug=$slug'>$name</a></li>"; } echo "</ul>"; echo "</li>"; } // if singular parent else { echo "<li><a href='category.php?slug=$slug'>$name</a></li>"; } } ?> My database tables: -- -- Table structure for table `categories_child` -- CREATE TABLE IF NOT EXISTS `categories_child` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(1000) NOT NULL, `slug` varchar(1000) NOT NULL, `parent` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=139 ; -- -- Dumping data for table `categories_child` -- INSERT INTO `categories_child` (`id`, `name`, `slug`, `parent`) VALUES (138, 'Britney Spears', 'category/celiberties/britney-spears/', 137), (136, 'Tigers', 'category/animals/tigers/', 136), (137, 'Horses', 'category/animals/horses/', 136), (135, 'Lions', 'category/animals/lions/', 136); -- -- Table structure for table `categories_parent` -- CREATE TABLE IF NOT EXISTS `categories_parent` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(1000) NOT NULL, `slug` varchar(1000) NOT NULL, `child_status` int(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=139 ; -- -- Dumping data for table `categories_parent` -- INSERT INTO `categories_parent` (`id`, `name`, `slug`, `child_status`) VALUES (137, 'Celiberties', 'category/celiberties/', 1), (138, 'TV Shows', 'category/tv-shows/', 0), (136, 'Animals', 'category/animals/', 1);

    Read the article

  • sql: Group by x,y,z; return grouped by x,y with lowest f(z)

    - by Sai Emrys
    This is for http://cssfingerprint.com I collect timing stats about how fast the different methods I use perform on different browsers, etc., so that I can optimize the scraping speed. Separately, I have a report about what each method returns for a handful of URLs with known-correct values, so that I can tell which methods are bogus on which browsers. (Each is different, alas.) The related tables look like this: CREATE TABLE `browser_tests` ( `id` int(11) NOT NULL AUTO_INCREMENT, `bogus` tinyint(1) DEFAULT NULL, `result` tinyint(1) DEFAULT NULL, `method` varchar(255) DEFAULT NULL, `url` varchar(255) DEFAULT NULL, `os` varchar(255) DEFAULT NULL, `browser` varchar(255) DEFAULT NULL, `version` varchar(255) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `user_agent` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=33784 DEFAULT CHARSET=latin1 CREATE TABLE `method_timings` ( `id` int(11) NOT NULL AUTO_INCREMENT, `method` varchar(255) DEFAULT NULL, `batch_size` int(11) DEFAULT NULL, `timing` int(11) DEFAULT NULL, `os` varchar(255) DEFAULT NULL, `browser` varchar(255) DEFAULT NULL, `version` varchar(255) DEFAULT NULL, `user_agent` varchar(255) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=28849 DEFAULT CHARSET=latin1 (user_agent is broken down pre-insert into browser, version, and os from a small list of recognized values using regex; I keep the original user-agent string just in case.) I have a query like this that tells me the average timing for every non-bogus browser / version / method tuple: select c, avg(bogus) as bog, timing, method, browser, version from browser_tests as b inner join ( select count(*) as c, round(avg(timing)) as timing, method, browser, version from method_timings group by browser, version, method having c > 10 order by browser, version, timing ) as t using (browser, version, method) group by browser, version, method having bog < 1 order by browser, version, timing; Which returns something like: c bog tim method browser version 88 0.8333 184 reuse_insert Chrome 4.0.249.89 18 0.0000 238 mass_insert_width Chrome 4.0.249.89 70 0.0400 246 mass_insert Chrome 4.0.249.89 70 0.0400 327 mass_noinsert Chrome 4.0.249.89 88 0.0556 367 reuse_reinsert Chrome 4.0.249.89 88 0.0556 383 jquery Chrome 4.0.249.89 88 0.0556 863 full_reinsert Chrome 4.0.249.89 187 0.0000 105 jquery Chrome 5.0.307.11 187 0.8806 109 reuse_insert Chrome 5.0.307.11 123 0.0000 110 mass_insert_width Chrome 5.0.307.11 176 0.0000 231 mass_noinsert Chrome 5.0.307.11 176 0.0000 237 mass_insert Chrome 5.0.307.11 187 0.0000 314 reuse_reinsert Chrome 5.0.307.11 187 0.0000 372 full_reinsert Chrome 5.0.307.11 12 0.7500 82 reuse_insert Chrome 5.0.335.0 12 0.2500 102 jquery Chrome 5.0.335.0 [...] I want to modify this query to return only the browser/version/method with the lowest timing - i.e. something like: 88 0.8333 184 reuse_insert Chrome 4.0.249.89 187 0.0000 105 jquery Chrome 5.0.307.11 12 0.7500 82 reuse_insert Chrome 5.0.335.0 [...] How can I do this, while still returning the method that goes with that lowest timing? I could filter it app-side, but I'd rather do this in mysql since it'd work better with my caching.

    Read the article

  • Msql Partitioning - Key vs Hash vs List vs Range

    - by Imran Omar Bukhsh
    I went through some of the documentation of mysql but cannot understand the difference in the following ways of partitioning : Key vs Hash vs List vs Range.Can someone explain in pure english? Also we have the following table: How do we partition by forum_id? CREATE TABLE IF NOT EXISTS `posts_content` ( `id` int(11) NOT NULL AUTO_INCREMENT, `post_id` int(11) NOT NULL, `forum_id` int(11) NOT NULL, `content` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=79850 ; Thanking you

    Read the article

  • How can I optimize the import of this dataset in mysql?

    - by GeoffreyF67
    I've got the following table schema: CREATE TABLE `alexa` ( `id` int(10) unsigned NOT NULL, `rank` int(10) unsigned NOT NULL, `domain` varchar(63) NOT NULL, `domainStatus` varchar(6) DEFAULT NULL, PRIMARY KEY (`rank`), KEY `domain` (`domain`), KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 It takes several minutes to import the data. To me that seems rather slow as we're only talking about a million rows of data. What can I do to optimize the insert of this data? (already using disable keys) G-Man

    Read the article

  • MySQL foreign key creation with alter table command

    - by user313338
    I created some tables using MySQL Workbench, and then did forward ‘forward engineer’ to create scripts to create these tables. BUT, the scripts lead me to a number of problems. One of which involves the foreign keys. So I tried creating separate foreign key additions using alter table and I am still getting problems. The code is below (the set statements, drop/create statements I left in … though I don’t think they should matter for this): SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL'; DROP SCHEMA IF EXISTS `mydb` ; CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ; -- ----------------------------------------------------- -- Table `mydb`.`User` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`User` ; CREATE TABLE IF NOT EXISTS `mydb`.`User` ( `UserName` VARCHAR(35) NOT NULL , `Num_Accts` INT NOT NULL , `Password` VARCHAR(45) NULL , `Email` VARCHAR(45) NULL , `User_ID` INT NOT NULL AUTO_INCREMENT , PRIMARY KEY (`User_ID`) ) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`User_Space` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`User_Space` ; CREATE TABLE IF NOT EXISTS `mydb`.`User_Space` ( `User_UserName` VARCHAR(35) NOT NULL , `User_Space_ID` INT NOT NULL AUTO_INCREMENT , PRIMARY KEY (`User_Space_ID`), FOREIGN KEY (`User_UserName`) REFERENCES `mydb`.`User` (`UserName`) ON UPDATE CASCADE ON DELETE CASCADE) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; The error this produces is: Error Code: 1005 Can't create table 'mydb.user_space' (errno: 150) Anybody know what the heck I’m doing wrong?? And anybody else have problems with the script generation done by mysql workbench? It’s a nice tool, but annoying that it pumps out scripts that don’t work for me. [As an fyi here’s the script it auto-generates: SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL'; DROP SCHEMA IF EXISTS `mydb` ; CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ; -- ----------------------------------------------------- -- Table `mydb`.`User` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`User` ; CREATE TABLE IF NOT EXISTS `mydb`.`User` ( `UserName` VARCHAR(35) NOT NULL , `Num_Accts` INT NOT NULL , `Password` VARCHAR(45) NULL , `Email` VARCHAR(45) NULL , `User_ID` INT NOT NULL AUTO_INCREMENT , PRIMARY KEY (`User_ID`) ) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`User_Space` -- ----------------------------------------------------- DROP TABLE IF EXISTS `mydb`.`User_Space` ; CREATE TABLE IF NOT EXISTS `mydb`.`User_Space` ( `User_Space_ID` INT NOT NULL AUTO_INCREMENT , PRIMARY KEY (`User_Space_ID`) , INDEX `User_ID` () , CONSTRAINT `User_ID` FOREIGN KEY () REFERENCES `mydb`.`User` () ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; ** Thanks!]

    Read the article

  • Character Sets explained for Dummies!

    - by Imran
    I don't think i fully understand character sets so i was wondering if anyone would be kind enough to explain it in layman's terms with examples ( for Dummies).I know there is utf8, latin1, ascii ect The more answers the better really. Thank you in advance;-)

    Read the article

  • (mySQL) Unable to query 2 tables properly for data

    - by Devner
    I have 2 tables. One is 'page_links' and the other is 'rpp'. Table page_links is the superset of table rpp. The following is the schema of my tables: -- Table structure for table `page_links` -- CREATE TABLE IF NOT EXISTS `page_links` ( `page` varchar(255) NOT NULL, `page_link` varchar(100) NOT NULL, `heading_id` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`page`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `page_links` -- INSERT INTO `page_links` (`page`, `page_link`, `heading_id`) VALUES ('a1.php', 'A1', 8), ('b1.php', 'B1', 8), ('c1.php', 'C1', 5), ('d1.php', 'D1', 5), ('e1.php', 'E1', 8), ('f1.php', 'F1', 8), ('g1.php', 'G1', 8), ('h1.php', 'H1', 1), ('i1.php', 'I1', 1), ('j1.php', 'J1', 8), ('k1.php', 'K1', 8), ('l1.php', 'L1', 8), ('m1.php', 'M1', 8), ('n1.php', 'N1', 8), ('o1.php', 'O1', 8), ('p1.php', 'P1', 4), ('q1.php', 'Q1', 5), ('r1.php', 'R1', 4); -- Table structure for table `rpp` -- CREATE TABLE IF NOT EXISTS `rpp` ( `role_id` tinyint(3) unsigned NOT NULL, `page` varchar(255) NOT NULL, `is_allowed` tinyint(1) NOT NULL, PRIMARY KEY (`role_id`,`page`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `rpp` -- INSERT INTO `rpp` (`role_id`, `page`, `is_allowed`) VALUES (3, 'a1.php', 1), (3, 'b1.php', 1), (3, 'c1.php', 1), (3, 'd1.php', 1), (3, 'e1.php', 1), (3, 'f1.php', 1), (3, 'h1.php', 1), (3, 'i1.php', 1), (3, 'l1.php', 1), (3, 'm1.php', 1), (3, 'n1.php', 1), (4, 'a1.php', 1), (4, 'b1.php', 1), (4, 'q1.php', 1), (5, 'r1.php', 1); WHAT I AM TRYING TO DO: I am trying to query both the above tables (in a single query) in such a way that all the pages from page_links are displayed along with the is_allowed value from rpp for a particular role. For example, I want to get the is_allowed value of all the pages from rpp for role_id = 3 and at the same time, list all the available pages from page_links. A clear example of my expected result would be: page is_allowed role_id ---------------------------------------- a1.php 1 3 b1.php 1 3 c1.php 1 3 d1.php 1 3 e1.php 1 3 f1.php 1 3 g1.php NULL NULL h1.php 1 3 i1.php 1 3 j1.php NULL NULL k1.php NULL NULL l1.php 1 3 m1.php 1 3 n1.php 1 3 o1.php NULL NULL p1.php NULL NULL q1.php NULL NULL r1.php NULL NULL One more example of my desired result could be achieved by doing a LEFT JOIN rpp ON page_links.page = rpp.page but we need to omit using role_id = 3 (or any value) to be able to get that. But I do want to specify the role_id as well and get the results. I need the query to be able to get this result. I would appreciate any replies that could help me with this. If you can suggest me any changes as well to the table(s) design to be able to achieve the desired result, that's good as well. Thanks in advance.

    Read the article

  • MySQL table data question?

    - by mySQL
    How should my Mysql table data look like for a single checkbox that checks and see if the user has said yes if its clicked or no if its not? Here is the checkbox. <input type="checkbox" name="yes" id="yes" value="yes" /> I was wondering how would I add it to the following table. CREATE TABLE IF NOT EXISTS `vote` ( `counter` int(8) NOT NULL default '0', `value` int(8) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    Read the article

  • MySQL: count enumerated values?

    - by John Isaacks
    If my table looks like this: daily_individual_tracking', 'CREATE TABLE `daily_individual_tracking` ( `daily_individual_tracking_id` int(10) unsigned NOT NULL auto_increment, `daily_individual_tracking_date` date NOT NULL default ''0000-00-00'', `sales` enum(''no'',''yes'') NOT NULL COMMENT ''no'', `repairs` enum(''no'',''yes'') NOT NULL COMMENT ''no'', `shipping` enum(''no'',''yes'') NOT NULL COMMENT ''no'', PRIMARY KEY (`daily_individual_tracking_id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 basically the fields can be either yes or no. How can I count how many yes's their are for each column over a date range? Thanks!!

    Read the article

  • mysql category tree search

    - by ffffff
    I have the following schema on MySQL 5.1 CREATE TABLE `mytest` ( `category` varchar(32) , `item_name` varchar(255) KEY `key1` (`category`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; category column is filled with like that [:parent_parent_cat_id][:parent_cat_id][:leaf_cat_id] "10000200003000" if you can search all of the under categories :parent_parent_category_id SELECT * FROM mytest WHERE category LIKE "10000%"; it's using index key1; but How to use index when I wanna search :parent_cat_id? SELECT * FROM mytest WHERE category LIKE "%20000%"; Do you have a better solutions?

    Read the article

  • GROUP BY and SUM distinct date across 2 tables

    - by kenitech
    I'm not sure if this is possible in one mysql query so I might just combine the results via php. I have 2 tables: 'users' and 'billing' I'm trying to group summed activity for every date that is available in these two tables. 'users' is not historical data but 'billing' contains a record for each transaction. In this example I am showing a user's status which I'd like to sum for created date and deposit amounts that I would also like to sum by created date. I realize there is a bit of a disconnect between the data but I'd like to some all of it together and display it as seen below. This will show me an overview of all of the users by when they were created and what the current statuses are next to total transactions. I've tried UNION as well as LEFT JOIN but I can't seem to get either to work. Union example is pretty close but doesn't combine the dates into one row. ( SELECT created, SUM(status) as totalActive, NULL as totalDeposit FROM users GROUP BY created ) UNION ( SELECT created, NULL as totalActive, SUM(transactionAmount) as totalDeposit FROM billing GROUP BY created ) I've also tried using a date lookup table and joining on the dates but the SUM values are being added multiple times. note: I don't care about the userIds at all but have it in here for the example. users table (where status of '1' denotes "active") (one record for each user) created | userId | status 2010-03-01 | 10 | 0 2010-03-01 | 11 | 1 2010-03-01 | 12 | 1 2010-03-10 | 13 | 0 2010-03-12 | 14 | 1 2010-03-12 | 15 | 1 2010-03-13 | 16 | 0 2010-03-15 | 17 | 1 billing table (record created for every instance of a billing "transaction" created | userId | transactionAmount 2010-03-01 | 10 | 50 2010-03-01 | 18 | 50 2010-03-01 | 19 | 100 2010-03-10 | 89 | 55 2010-03-15 | 16 | 50 2010-03-15 | 12 | 90 2010-03-22 | 99 | 150 desired result: created | sumStatusActive | sumStatusInactive | sumTransactions 2010-03-01 | 2 | 1 | 200 2010-03-10 | 0 | 1 | 55 2010-03-12 | 2 | 0 | 0 2010-03-13 | 0 | 0 | 0 2010-03-15 | 1 | 0 | 140 2010-03-22 | 0 | 0 | 150 Table dump: CREATE TABLE IF NOT EXISTS `users` ( `created` date NOT NULL, `userId` int(11) NOT NULL, `status` smallint(6) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `users` (`created`, `userId`, `status`) VALUES ('2010-03-01', 10, 0), ('2010-03-01', 11, 1), ('2010-03-01', 12, 1), ('2010-03-10', 13, 0), ('2010-03-12', 14, 1), ('2010-03-12', 15, 1), ('2010-03-13', 16, 0), ('2010-03-15', 17, 1); CREATE TABLE IF NOT EXISTS `billing` ( `created` date NOT NULL, `userId` int(11) NOT NULL, `transactionAmount` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `billing` (`created`, `userId`, `transactionAmount`) VALUES ('2010-03-01', 10, 50), ('2010-03-01', 18, 50), ('2010-03-01', 19, 100), ('2010-03-10', 89, 55), ('2010-03-15', 16, 50), ('2010-03-15', 12, 90), ('2010-03-22', 99, 150);

    Read the article

  • sql and web encoding problem

    - by Marki
    Guys, I've got an encoding problem I believe. I have upgraded from phpBB2 to phpBB3. The old databases were in latin1, the new ones have utf8 encoding. Already during the upgrade process some rows of the DB were only read partly into the new version, because of strange characters as it turned out. When I use PHP's mb_convert_encoding() function to convert those strings to UTF8 they end up e.g. as 0x0093, i.e. they must have been some kind of double quotes. Even after doing this conversion, they still show up as 0x0093 in the browser (the squares with 0093 in them when the browser does not know what to display). Can someone explain the problem here? I'm a little confused and afraid I don't see all the dependencies that need to work to have the correct encodings and the correct display thereof...

    Read the article

  • MySQL keeps crashing OS server.. Please help adjust my.ini!

    - by TruMan1
    I have MySQL 5.0 installed on a Windows 2008 machine (3GB RAM). My server crashes on a regular basis (almost once a day) with this error: Changed limits: max_open_files: 2048 max_connections: 800 table_cache: 619 I did not use the heavy InnoDB .ini file, although I am rethinking that I should have? I am worried that big configuration changes will make my current sites stop working. What should I do? Here is my current ini settings: default-character-set=latin1 default-storage-engine=INNODB max_connections=800 query_cache_size=84M table_cache=1520 tmp_table_size=30M thread_cache_size=38 myisam_max_sort_file_size=100G myisam_sort_buffer_size=30M key_buffer_size=129M read_buffer_size=64K read_rnd_buffer_size=256K sort_buffer_size=256K innodb_additional_mem_pool_size=6M innodb_flush_log_at_trx_commit=1 innodb_log_buffer_size=3M innodb_buffer_pool_size=250M innodb_log_file_size=50M innodb_thread_concurrency=10

    Read the article

  • MySQL Database Query Problem

    - by moustafa
    I need your help!!!. I need to query a table in my database that has record of goods sold. I want the query to detect a particular product and also calculate the quantity sold. The product are 300 now, but it would increase in the future. Below is a sample of my DB Table #---------------------------- # Table structure for litorder #---------------------------- CREATE TABLE `litorder` ( `id` int(10) NOT NULL auto_increment, `name` varchar(50) NOT NULL default '', `address` varchar(50) NOT NULL default '', `xdate` date NOT NULL default '0000-00-00', `ref` varchar(20) NOT NULL default '', `code1` varchar(50) NOT NULL default '', `code2` varchar(50) NOT NULL default '', `code3` varchar(50) NOT NULL default '', `code4` varchar(50) NOT NULL default '', `code5` varchar(50) NOT NULL default '', `code6` varchar(50) NOT NULL default '', `code7` varchar(50) NOT NULL default '', `code8` varchar(50) NOT NULL default '', `code9` varchar(50) NOT NULL default '', `code10` varchar(50) NOT NULL default '', `code11` varchar(50) character set latin1 collate latin1_bin NOT NULL default '', `code12` varchar(50) NOT NULL default '', `code13` varchar(50) NOT NULL default '', `code14` varchar(50) NOT NULL default '', `code15` varchar(50) NOT NULL default '', `product1` varchar(100) NOT NULL default '0', `product2` varchar(100) NOT NULL default '0', `product3` varchar(100) NOT NULL default '0', `product4` varchar(100) NOT NULL default '0', `product5` varchar(100) NOT NULL default '0', `product6` varchar(100) NOT NULL default '0', `product7` varchar(100) NOT NULL default '0', `product8` varchar(100) NOT NULL default '0', `product9` varchar(100) NOT NULL default '0', `product10` varchar(100) NOT NULL default '0', `product11` varchar(100) NOT NULL default '0', `product12` varchar(100) NOT NULL default '0', `product13` varchar(100) NOT NULL default '0', `product14` varchar(100) NOT NULL default '0', `product15` varchar(100) NOT NULL default '0', `price1` int(10) NOT NULL default '0', `price2` int(10) NOT NULL default '0', `price3` int(10) NOT NULL default '0', `price4` int(10) NOT NULL default '0', `price5` int(10) NOT NULL default '0', `price6` int(10) NOT NULL default '0', `price7` int(10) NOT NULL default '0', `price8` int(10) NOT NULL default '0', `price9` int(10) NOT NULL default '0', `price10` int(10) NOT NULL default '0', `price11` int(10) NOT NULL default '0', `price12` int(10) NOT NULL default '0', `price13` int(10) NOT NULL default '0', `price14` int(10) NOT NULL default '0', `price15` int(10) NOT NULL default '0', `quantity1` int(10) NOT NULL default '0', `quantity2` int(10) NOT NULL default '0', `quantity3` int(10) NOT NULL default '0', `quantity4` int(10) NOT NULL default '0', `quantity5` int(10) NOT NULL default '0', `quantity6` int(10) NOT NULL default '0', `quantity7` int(10) NOT NULL default '0', `quantity8` int(10) NOT NULL default '0', `quantity9` int(10) NOT NULL default '0', `quantity10` int(10) NOT NULL default '0', `quantity11` int(10) NOT NULL default '0', `quantity12` int(10) NOT NULL default '0', `quantity13` int(10) NOT NULL default '0', `quantity14` int(10) NOT NULL default '0', `quantity15` int(10) NOT NULL default '0', `amount1` int(10) NOT NULL default '0', `amount2` int(10) NOT NULL default '0', `amount3` int(10) NOT NULL default '0', `amount4` int(10) NOT NULL default '0', `amount5` int(10) NOT NULL default '0', `amount6` int(10) NOT NULL default '0', `amount7` int(10) NOT NULL default '0', `amount8` int(10) NOT NULL default '0', `amount9` int(10) NOT NULL default '0', `amount10` int(10) NOT NULL default '0', `amount11` int(10) NOT NULL default '0', `amount12` int(10) NOT NULL default '0', `amount13` int(10) NOT NULL default '0', `amount14` int(10) NOT NULL default '0', `amount15` int(10) NOT NULL default '0', `totalNaira` double(20,0) NOT NULL default '0', `totalDollar` int(20) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='InnoDB free: 4096 kB; InnoDB free: 4096 kB; InnoDB free: 409'; #---------------------------- # Records for table litorder #---------------------------- insert into litorder values (27, 'Sanyaolu Fisayo', '14 Adegboyega Street Palmgrove Lagos', '2010-05-31', '', 'DL 001', 'DL 002', 'DL 003', '', '', '', '', '', '', '', '', '', '', '', '', 'AILMENT & PREVENTION DVD- ENGLISH', 'AILMENT & PREVENTION DVD- HAUSA', 'BEAUTY CD', '', '', '', '', '', '', '', '', '', '', '', '', 800, 800, 3000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12800, 12800, 60000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '85600', 563), (28, 'Irenonse Esther', 'Lagos,Nigeria', '2010-06-01', '', 'DL 005', 'DL 008', 'FC 004', '', '', '', '', '', '', '', '', '', '', '', '', 'GET HEALTHY DVD', 'YOUR FUTURE DVD', 'FOREVER FACE CAP (YELLOW)', '', '', '', '', '', '', '', '', '', '', '', '', 1000, 900, 2000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2000, 1800, 6000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '9800', 64), (29, 'Kalu Lekway', 'Lagos, Nigeria', '2010-06-01', '', 'DL 001', 'DL 003', '', '', '', '', '', '', '', '', '', '', '', '', '', 'AILMENT & PREVENTION DVD- ENGLISH', 'BEAUTY CD', '', '', '', '', '', '', '', '', '', '', '', '', '', 800, 3000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2400, 18000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '20400', 133), (30, 'Dele', 'Ilupeju', '2010-06-02', '', 'DL 001', 'DL 003', '', '', '', '', '', '', '', '', '', '', '', '', '', 'AILMENT & PREVENTION DVD- ENGLISH', 'BEAUTY CD', '', '', '', '', '', '', '', '', '', '', '', '', '', 800, 3000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8000, 30000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '38000', 250);

    Read the article

  • Malformed packet error during MySQL LOAD DATA LOCAL INFILE

    - by dnagirl
    I am trying to load a file into an MySQL(v5.1.38) innodb table using PHP's mysqli::query and a LOAD DATA LOCAL INFILE query. The query returns a 'Malformed packet' error code 2027. Any ideas what is wrong? Here is the target table: CREATE TABLE `zbroom`.`lee_datareceive` ( `a` varchar(45) NOT NULL, `b` varchar(45) NOT NULL, `c` varchar(45) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; Here is the query: LOAD DATA LOCAL INFILE '/path/to/file.txt' INTO TABLE lee_datareceive FIELDS TERMINATED BY '\t'; Here is the file data. Values are tab separated: t1 t2 t3 a b c d e f g h i

    Read the article

  • What can cause legit MySql INSERT INTO command to fail?

    - by Makis
    I can't figure out what's causing my INSERT INTO's to fail to certain table in MySql. I can manage them to other tables. The table looks like: CREATE TABLE IF NOT EXISTS `Match` ( `id` int(11) NOT NULL AUTO_INCREMENT, `match_no` int(11) NOT NULL, `season` int(11) NOT NULL, `hometeam` int(11) NOT NULL, `awayteam` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `match_no` (`match_no`), KEY `season` (`season`), KEY `hometeam` (`hometeam`), KEY `awayteam` (`awayteam`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; And the command is INSERT INTO Match (`match_no`, `season`, `hometeam`, `awaytem`) VALUES (1, 1, 2, 3) All I get is: 1064 - 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 'Match (match_no, season, hometeam, awaytem) VALUES (1, 1, 2, 3)' at line 1 I have checked the manual and half-a-dozen examples from the web and whatnought and tried all sorts of changes to the syntax in case there is some MySql specific oddity, but nothing seems to work.

    Read the article

  • [MYSQL] Select users who own both a dog and a cat

    - by matte
    Hi, I have this sample table: CREATE TABLE `dummy` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userId` int(11) NOT NULL, `pet` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; INSERT INTO `dummy` (`id`, `userId`, `pet`) VALUES(1, 1, 'dog'); INSERT INTO `dummy` (`id`, `userId`, `pet`) VALUES(2, 1, 'cat'); INSERT INTO `dummy` (`id`, `userId`, `pet`) VALUES(3, 2, 'dog'); INSERT INTO `dummy` (`id`, `userId`, `pet`) VALUES(4, 2, 'cat'); INSERT INTO `dummy` (`id`, `userId`, `pet`) VALUES(5, 3, 'cat'); INSERT INTO `dummy` (`id`, `userId`, `pet`) VALUES(6, 4, 'dog'); How can I write the statements below in mysql: Retrieve all users who own both a dog and a cat Retrieve all users who own a dog or a cat Retrieve all users who own only a cat Retrieve all users who doesn't own a cat Thanks!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8  | Next Page >