数据库设计问题(或问题)(Database design problem (or question))
我正在设计一个有三个表的数据库:用户,游戏和(可能)注册。 我想表示用户可以在零个或多个游戏中注册。
我使用表寄存器在游戏中注册用户。
我还需要将用户的分数存储在游戏中。
我的问题是:
我可以在表格寄存器中添加一个名为score的列吗? 这是一个好的设计吗?
谢谢。
I'm designing a database with three tables: user, game and (probably) register. I want to represent that a user can be registered on zero or more games.
I use table register to register a user in a game.
I also need to store the score of the user in a game.
My question is:
Can I add a column called score in table register? Is it a good design?
Thanks.
原文:https://stackoverflow.com/questions/3942761
更新时间:2022-11-27 06:11
最满意答案
你真的很接近,你想
clone
和insertBefore
(并记住,eq
是从零开始的):$('#main ul li:eq(2)').clone().insertBefore('#main ul li:eq(1)');
You were really close, you wanted
clone
andinsertBefore
(and remember thateq
is zero-based):$('#main ul li:eq(2)').clone().insertBefore('#main ul li:eq(1)');
相关问答
更多-
你可以使用jQuery.append() http://api.jquery.com/append/ 然后你可以做一些事情: $('li#myListItem').append('New Content'); You can use jQuery.append() http://api.jquery.com/append/ And then you can do something like: $('li#myListItem').append('New Content ...你的jquery函数已经做了你想要的,即将它们分组为6,所以你只需要删除包含列表的.main-list。 你需要做的就是在循环后解开。 $('.main-list>ul').unwrap(); 即 $(document).ready(function() { var lis = $(".main-list li"); for(var i = 0; i < lis.length; i+=6) { lis.slice(i, i+6) .wrapAll("我认为它应该是 var ul = $('#gallery ul'); ul.find('li:first').clone(true).appendTo(ul); I think it should be var ul = $('#gallery ul'); ul.find('li:first').clone(true).appendTo(ul);
JQuery - 附加(复制,克隆)李,并把它放在li上面(JQuery - Attach (duplicate, clone) li and put it above a li)[2022-06-14]
你真的很接近,你想clone和insertBefore (并记住, eq是从零开始的): $('#main ul li:eq(2)').clone().insertBefore('#main ul li:eq(1)'); 现场示例 You were really close, you wanted clone and insertBefore (and remember that eq is zero-based): $('#main ul li:eq(2)').clone().insertBefore( ...克隆
- 并使用jQuery抛出(Clone
- and throw with jQuery)
[2023-12-20]var ul = $('ul'); var lis = ul.children('li'); ul.prepend(lis.slice(Math.round(lis.length / 2))) 示例: http : //jsfiddle.net/8SNGn/ 这首先使用children() [docs]方法缓存- 元素及其
- 子元素。 然后它使用prepend() [docs]方法将最后的li元素添加到ul的开头。 您可以使用slice() [docs]方法获取最后一个,并将li元素的总数除以2 ...
jquery $(“”)(jquery $(“”))[2022-07-15]
创建一个新的( 但是空的 ) li元素,类似于document.createElement("li"); 。 试着这样做: alert($("")[0]); 基本上,单独它并没有做太多。 要将其添加到现有元素,您可以执行以下操作: $("").appendTo("body"); $("").appendTo("#elementId"); Create's a new (but empty) li element, similar to document.createE ...$('.color-list').on("click", function (e) { $('.color-list').children().css("background-color", $(e.target).text()); $('.color-list').children().css("font-weight", ""); $(e.target).css("font-weight", "bold"); $('.color-list').children().cs ...使用.before()在另一个元素之前放置一些东西。 createPagination: function (nb) { var nextLI = $('pagination .pageNext'); var lastLI = nextLI.prev(); var num = lastLI.attr('name'); for (var i = num+1; i <= nb ; i++) { var cloned = lastLI.clone().attr(' ...直接向前逻辑我的朋友:已经删除了你附加了mouseenter handler的li元素。 新插入的li元素不会获得mouseenter handler,除非在插入它们后再次附加它们。 在myfunction您必须为新插入的li元素附加myfunction处理程序。 更改您的代码,如下所示。 注意更改 - 移动myfunction处理程序附加myfunction内的myfunction 。 var k = 10; myfunction(k); $('#a').click(function(){ ...做: j('#region_navlist li').on('click', function() { j(this).nextAll().andSelf().remove(); }); 请参阅: andSelf()和nextAll() Note:- .live() is deprecated you use .on() if version 1.7 do: j('#region_navlist li').on('click', function() { j(this).nextAll( ...相关文章
更多- What Is Software Design? 先放上来有空看看~
- HDFS Append 设计文档的QA(Questions about the “Append Design”)
- 腾讯高级设计师谈微信的旧容与新妆,Android Design是大势所趋
- 《无懈可击的WEB设计(第2版)》(Bulletproof Web Design: Improving flexibility and protecting against worst-case scenarios with XHTML and CSS (2nd Edition))扫描版[PDF]
- HTML5 Web SQL Database 数据库
- 数据库设计
- 数据库设计问题
- 数据库设计 Step by Step (1)
- 数据库设计 Step by Step (1)——扬帆启航
- 数据库设计 Step by Step (1)——扬帆启航
最新问答
更多- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
- 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
- xcode语法颜色编码解释?(xcode syntax color coding explained?)
- 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
- 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
- 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
- 西安哪有PLC可控制编程的培训
- 在Entity Framework中选择基类(Select base class in Entity Framework)
- 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
- 电脑二级VF有什么用
- Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
- 金华英语角.
- 手机软件如何制作
- 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
- 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
- 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
- Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
- 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
- python的访问器方法有哪些
- DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
- 在Ruby中对组合进行排序(Sorting a combination in Ruby)
- 网站开发的流程?
- 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
- 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
- 透明度错误IE11(Transparency bug IE11)
- linux的基本操作命令。。。